45 lines
1 KiB
Text
45 lines
1 KiB
Text
|
# Generated by ansible for site {{ site_url }}
|
||
|
# At {{ subnet_site_ip }} on {{ subnet_cidr_address }}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
server_name {{ site_url }} www.{{ site_url }};
|
||
|
|
||
|
rewrite ^ https://{{ site_url }}$request_uri permanent;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 443 ssl;
|
||
|
listen [::]:443 ssl;
|
||
|
server_name {{ site_url }} www.{{ site_url }};
|
||
|
|
||
|
access_log /var/log/nginx/{{ site_name }}-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/{{ site_url }}/fullchain.pem;
|
||
|
ssl_certificate_key /etc/letsencrypt/live/{{ site_url }}/privkey.pem;
|
||
|
|
||
|
if ($host = www.{{ site_url }}) {
|
||
|
rewrite ^ https://{{ site_url }}$request_uri permanent;
|
||
|
}
|
||
|
|
||
|
# Run by host
|
||
|
# root /var/www/{{ site_name }};
|
||
|
# include snippets/wordpress.conf;
|
||
|
|
||
|
# Run in Docker
|
||
|
include snippets/header-params_server.conf;
|
||
|
location / {
|
||
|
include snippets/header-params_location.conf;
|
||
|
|
||
|
proxy_pass http://{{ subnet_site_ip }}:80;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|