2019-02-19 11:10:05 +01:00
|
|
|
# {{ ansible_managed }}
|
|
|
|
|
2019-02-05 08:35:45 +01:00
|
|
|
server {
|
2019-03-14 10:53:44 +01:00
|
|
|
# Common proxy snippet
|
2019-02-05 08:35:45 +01:00
|
|
|
include "snippets/proxy-common.conf";
|
|
|
|
|
2019-03-14 10:53:44 +01:00
|
|
|
# Set witch server name we define
|
|
|
|
server_name {{ item.from }};
|
|
|
|
|
|
|
|
# Permanentely moved to HTTPS
|
|
|
|
return 301 https://$host$request_uri;
|
2019-02-05 08:35:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2019-03-14 10:53:44 +01:00
|
|
|
# Common proxy snippet
|
2019-02-05 08:35:45 +01:00
|
|
|
include "snippets/proxy-common-ssl.conf";
|
2019-03-14 10:53:44 +01:00
|
|
|
|
|
|
|
# Set witch server name we define
|
2019-02-05 08:35:45 +01:00
|
|
|
server_name {{ item.from }};
|
|
|
|
|
|
|
|
# Separate log files
|
|
|
|
access_log /var/log/nginx/{{ item.name }}.access.log;
|
|
|
|
error_log /var/log/nginx/{{ item.name }}.error.log;
|
|
|
|
|
|
|
|
# Use LetsEncrypt SSL
|
2019-02-07 09:33:20 +01:00
|
|
|
ssl_certificate /etc/letsencrypt/live/auro.re/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/auro.re/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/auro.re/chain.pem;
|
2019-02-05 08:35:45 +01:00
|
|
|
|
|
|
|
location / {
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_pass http://{{ item.to }};
|
|
|
|
proxy_set_header Host {{ item.from }};
|
|
|
|
proxy_set_header P-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
|
|
|
|
|
|
# "A man is not dead while his name is still spoken." -- Going Postal
|
|
|
|
add_header X-Clacks-Overhead "GNU Terry Pratchett";
|
|
|
|
}
|
|
|
|
}
|