From 25d235526f547a4d03ed2efa0daa74554ce9a33d Mon Sep 17 00:00:00 2001 From: Guilherme Rezende Date: Mon, 16 Oct 2017 16:29:10 -0200 Subject: [PATCH] contrib: improve security on nginx --- contrib/nginx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/contrib/nginx b/contrib/nginx index e65044b..27855c7 100644 --- a/contrib/nginx +++ b/contrib/nginx @@ -1,11 +1,16 @@ server { - listen 443 ssl; - server_name jarbas.serenatadeamor.org; - ssl_certificate /etc/letsencrypt/live/jarbas.serenatadeamor.org/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/jarbas.serenatadeamor.org/privkey.pem; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers HIGH:!aNULL:!MD5; - access_log on; + listen 443 ssl; + server_name jarbas.serenatadeamor.org; + ssl_certificate /etc/letsencrypt/live/jarbas.serenatadeamor.org/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/jarbas.serenatadeamor.org/privkey.pem; + ssl_prefer_server_ciphers on; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!MD5; + access_log on; + add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"; + add_header X-Content-Type-Options nosniff; + add_header X-XSS-Protection "1; mode=block"; + location /.well-known/ { alias /opt/jarbas/staticfiles/.well-known/; @@ -30,6 +35,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; + add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"; } }