update vhost templates: use of includes

This commit is contained in:
dadel 2017-04-04 14:01:10 +02:00
parent 1c7517e52c
commit 8b2236a66f
1 changed files with 5 additions and 22 deletions

View File

@ -1,5 +1,4 @@
# redirect http to https # redirect http to https
server { server {
listen [::]:80; listen [::]:80;
server_name {{ second_domains }}; server_name {{ second_domains }};
@ -7,31 +6,17 @@ server {
} }
# conf for https # conf for https
server { server {
listen [::]:443; listen [::]:443;
server_name {{ second_domains }}; server_name {{ second_domains }};
include /etc/nginx/includes/le-acme.conf;
# conf for LE ACME include /etc/nginx/includes/ssl.conf ;
location ~ /.well-known/acme-challenge/ { include /etc/nginx/includes/add-headers.conf ;
default_type "text/plain";
root /var/lib/acme/challenges ;
}
location = /.well-known/acme-challenge/ {
return 404;
}
# TLS conf # TLS conf
ssl on; ssl_certificate /etc/nginx/sites/{{ main_domain }}/{{ main_domain }}.chained;
ssl_certificate /etc/nginx/sites/{{ main_domain }}/{{ main_domain }}.chained; ssl_certificate_key /etc/nginx/sites/{{ main_domain }}/{{ main_domain }}.key;
ssl_certificate_key /etc/nginx/sites/{{ main_domain }}/{{ main_domain }}.key;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security max-age=2678400;
ssl_dhparam /etc/nginx/dh4096.pem;
ssl_session_cache shared:SSL:50m;
# reverse proxy # reverse proxy
location / { location / {
@ -42,5 +27,3 @@ server {
proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Ssl on;
} }
} }