Update TLS settings in nginx proxy

This commit is contained in:
2022-08-27 18:56:12 -04:00
parent 4f4a341b05
commit b9f9b0bf3c
3 changed files with 22 additions and 5 deletions

View File

@@ -1,12 +1,13 @@
server {
listen 80;
server_name {{ item.domain }};
return 301 https://{{ item.domain }}$request_uri;
listen 80;
listen [::]:80;
server_name {{ item.domain }};
return 301 https://{{ item.domain }}$request_uri;
}
server {
listen 443 ssl;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ item.domain }};
access_log /var/log/nginx/{{ item.domain }}.log main;
{% if proxy.production is defined and proxy.production and proxy.dns_cloudflare.wildcard_domains is defined and item.tls.cert is not defined %}
@@ -27,6 +28,9 @@ server {
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
{% endif %}
{% if item.hsts is defined %}
add_header Strict-Transport-Security "max-age={{ item.hsts }}" always;
{% endif %}
{% if item.client_max_body_size is defined %}
client_max_body_size {{ item.client_max_body_size }};
{% endif %}