diff --git a/nginx.conf b/nginx.conf index 5e8508a..fb11cbb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -50,7 +50,6 @@ http { ssl_certificate /etc/letsencrypt/live/triton.fet.at/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/triton.fet.at/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/triton.fet.at/chain.pem; - include snippets/ssl.conf; # return 503;# http://$host$request_uri; #444 diff --git a/snippets/header.conf b/snippets/header.conf new file mode 100644 index 0000000..6de8657 --- /dev/null +++ b/snippets/header.conf @@ -0,0 +1,6 @@ +# -*-nginx-*- +add_header X-Content-Type-Options nosniff; +add_header Content-Security-Policy "default-src 'self'"; +add_header X-XSS-Protection "1; mode=block"; +add_header Referrer-Policy "strict-origin"; +add_header Strict-Transport-Security "max-age=31536000" always; diff --git a/snippets/ldap.conf b/snippets/ldap.conf new file mode 100644 index 0000000..98ae498 --- /dev/null +++ b/snippets/ldap.conf @@ -0,0 +1,3 @@ +# -*-nginx-*- +auth_ldap "FET Login"; +auth_ldap_servers fet; diff --git a/snippets/letsencrypt.conf b/snippets/letsencrypt.conf new file mode 100644 index 0000000..e90ab04 --- /dev/null +++ b/snippets/letsencrypt.conf @@ -0,0 +1,11 @@ +# -*-nginx-*- +location /.well-known/ { + default_type "text/plain"; + root /var/www/html; +} +location = /.well-known/acme-challenge/ { + return 404; +} +location / { + return 301 https://$host$request_uri; +} diff --git a/snippets/proxy_header.conf b/snippets/proxy_header.conf new file mode 100644 index 0000000..55da64a --- /dev/null +++ b/snippets/proxy_header.conf @@ -0,0 +1,6 @@ +# -*-nginx-*- +proxy_set_header Host $host; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X_FORWARDED_SSL on; +proxy_set_header HTTP_X_FORWARDED_SSL on; +proxy_set_header X-Forwarded-For $remote_addr; diff --git a/snippets/ssl.conf b/snippets/ssl.conf new file mode 100644 index 0000000..00d2515 --- /dev/null +++ b/snippets/ssl.conf @@ -0,0 +1,15 @@ +# -*-nginx-*- +ssl_session_timeout 1d; +ssl_session_cache shared:SSL:50m; +ssl_session_tickets off; + +ssl_dhparam dhparam.pem; + +ssl_protocols TLSv1 TLSv1.1 TLSv1.2; +ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; +ssl_prefer_server_ciphers on; + +#add_header Strict-Transport-Security max-age=15768000; + +ssl_stapling on; +ssl_stapling_verify on;