55 lines
1.7 KiB
Django/Jinja
55 lines
1.7 KiB
Django/Jinja
server {
|
|
listen 80;
|
|
server_name {{ item.name }};
|
|
{% if item.alias is defined %}
|
|
{% for alias in item.alias %}
|
|
server_name {{ alias }};
|
|
{% endfor %}
|
|
{% endif %}
|
|
include snippets/letsencrypt.conf;
|
|
location / { return 301 https://$http_host$request_uri; }
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name {{ item.name }};
|
|
ssl_certificate /var/lib/dehydrated/certs/{{ item.name }}/fullchain.pem;
|
|
ssl_certificate_key /var/lib/dehydrated/certs/{{ item.name }}/privkey.pem;
|
|
include /etc/nginx/proxy_params;
|
|
add_header Referrer-Policy $referrerpolicy;
|
|
add_header Strict-Transport-Security $sts;
|
|
add_header X-Content-Type-Options $xcontentoptions;
|
|
add_header X-XSS-Protection $xxssprotection;
|
|
|
|
location ~ /.well-known/(carddav|caldav) {
|
|
return 301 $scheme://$host/remote.php/dav;
|
|
}
|
|
|
|
location ~ \.* {
|
|
proxy_pass http://{{ inventory_hostname }}:80;
|
|
}
|
|
}
|
|
|
|
{% if item.alias is defined %}
|
|
{% for alias in item.alias %}
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name {{ alias }};
|
|
ssl_certificate /var/lib/dehydrated/certs/{{ alias }}/fullchain.pem;
|
|
ssl_certificate_key /var/lib/dehydrated/certs/{{ alias }}/privkey.pem;
|
|
include /etc/nginx/proxy_params;
|
|
add_header Referrer-Policy $referrerpolicy;
|
|
add_header Strict-Transport-Security $sts;
|
|
add_header X-Content-Type-Options $xcontentoptions;
|
|
add_header X-XSS-Protection $xxssprotection;
|
|
|
|
location ~ /.well-known/(carddav|caldav) {
|
|
return 301 $scheme://$host/remote.php/dav;
|
|
}
|
|
|
|
location ~ \.* {
|
|
proxy_pass http://{{ inventory_hostname }}:80;
|
|
}
|
|
}
|
|
{% endfor %}
|
|
{% endif %}
|