Explorar el Código

fix well-known acme directory handling

master
padre
commit
b67b774cf8
Se han modificado 3 ficheros con 17 adiciones y 6 borrados
  1. +1
    -0
      handlers/main.yml
  2. +5
    -0
      tasks/main.yml
  3. +11
    -6
      templates/default-vhost.j2

+ 1
- 0
handlers/main.yml Ver fichero

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

+ 5
- 0
tasks/main.yml Ver fichero

@@ -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 Ver fichero

@@ -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>



Cargando…
Cancelar
Guardar