2017-02-20 09:25:18 +01:00
|
|
|
# redirect http to https
|
|
|
|
server {
|
|
|
|
listen [::]:80;
|
|
|
|
server_name {{ second_domains }};
|
|
|
|
return 301 https://$server_name$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
# conf for https
|
|
|
|
server {
|
|
|
|
listen [::]:443;
|
|
|
|
server_name {{ second_domains }};
|
|
|
|
|
2017-04-04 14:01:10 +02:00
|
|
|
include /etc/nginx/includes/le-acme.conf;
|
|
|
|
include /etc/nginx/includes/ssl.conf ;
|
|
|
|
include /etc/nginx/includes/add-headers.conf ;
|
2017-02-20 09:25:18 +01:00
|
|
|
|
|
|
|
# TLS conf
|
2017-04-04 14:01:10 +02:00
|
|
|
ssl_certificate /etc/nginx/sites/{{ main_domain }}/{{ main_domain }}.chained;
|
|
|
|
ssl_certificate_key /etc/nginx/sites/{{ main_domain }}/{{ main_domain }}.key;
|
2017-02-20 09:25:18 +01:00
|
|
|
|
|
|
|
# reverse proxy
|
|
|
|
location / {
|
|
|
|
proxy_pass http://[{{ ip6_back }}];
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Ssl on;
|
|
|
|
}
|
|
|
|
}
|