41 lines
1.2 KiB
Django/Jinja
41 lines
1.2 KiB
Django/Jinja
# ANSIBLE MAINTAINED FILE - DO NOT EDIT MANUALLY
|
|
upstream {{ item.key }} {
|
|
server {{ item.value.upstream }};
|
|
}
|
|
|
|
server {
|
|
server_name {{ item.key }};
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
include /etc/nginx/snippets/security-hardening.conf;
|
|
ssl_certificate /etc/letsencrypt/live/{{ item.key }}/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/{{ item.key }}/privkey.pem;
|
|
|
|
location / {
|
|
include /etc/nginx/snippets/security-headers.conf;
|
|
proxy_pass http://{{ item.key }};
|
|
proxy_set_header Connection $http_connection;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_connect_timeout 15;
|
|
proxy_send_timeout 15;
|
|
limit_except GET POST {
|
|
deny all;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
server {
|
|
server_name {{ item.key }};
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|