41 lines
902 B
Text
41 lines
902 B
Text
|
# Generated by ansible for site {{ item.url }}
|
||
|
# At {{ item.subnet_site_ip }} on {{ item.subnet_cidr_address }}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
server_name {{ item.url }};
|
||
|
|
||
|
# Let's Encrypt
|
||
|
include snippets/letsencrypt.conf;
|
||
|
|
||
|
location / {
|
||
|
return 301 https://$server_name$request_uri;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 443 ssl;
|
||
|
listen [::]:443 ssl;
|
||
|
server_name {{ item.url }};
|
||
|
|
||
|
access_log /var/log/nginx/{{ item.slug }}-access.log;
|
||
|
error_log /var/log/nginx/error.log;
|
||
|
|
||
|
# Let's Encrypt
|
||
|
include snippets/letsencrypt.conf;
|
||
|
|
||
|
include snippets/ssl-params.conf;
|
||
|
ssl_certificate /etc/letsencrypt/live/{{ item.url }}/fullchain.pem;
|
||
|
ssl_certificate_key /etc/letsencrypt/live/{{ item.url }}/privkey.pem;
|
||
|
|
||
|
include snippets/header-params_server.conf;
|
||
|
location / {
|
||
|
include snippets/header-params_location.conf;
|
||
|
|
||
|
proxy_pass http://{{ item.subnet_site_ip }}:80;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|