ソースを参照

fix well-known acme directory handling

master
コミット
b67b774cf8
3個のファイルの変更17行の追加6行の削除
  1. +1
    -0
      handlers/main.yml
  2. +5
    -0
      tasks/main.yml
  3. +11
    -6
      templates/default-vhost.j2

+ 1
- 0
handlers/main.yml ファイルの表示

@@ -9,3 +9,4 @@
service:
name: apache2
state: reloaded
listen: certificate changed

+ 5
- 0
tasks/main.yml ファイルの表示

@@ -16,3 +16,8 @@
src: default-vhost.j2
dest: /etc/apache2/sites-available/000-default.conf
notify: reload apache

- name: ensure apache is started
service:
name: apache2
state: started

+ 11
- 6
templates/default-vhost.j2 ファイルの表示

@@ -1,15 +1,20 @@
<VirtualHost *:443>
<VirtualHost _default_:443>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

DocumentRoot /var/www/default/
<Directory "/var/www/default/">
Options -Indexes
</Directory>

SSLEngine on
SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem"
SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key"

</VirtualHost>

<VirtualHost *:80>
<VirtualHost _default_:80>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
@@ -19,10 +24,10 @@
Options -Indexes
</Directory>

#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# redirect to https if file could not be found in /var/www/default/
RewriteEngine On
RewriteRule ^\/\.well-known\/acme-challenge\/ - [L]
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

</VirtualHost>



読み込み中…
キャンセル
保存