Skip to content

Instantly share code, notes, and snippets.

@jermainee
Created September 8, 2018 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jermainee/6f8d3134b1dd71bc1caa4f0c78c5143a to your computer and use it in GitHub Desktop.
Save jermainee/6f8d3134b1dd71bc1caa4f0c78c5143a to your computer and use it in GitHub Desktop.
Let's Encrypt HTTPS configuration on NGINX
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/certs/dhparam2048.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDS$
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
#add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http$
# LetsEncrypt
location ~ /.well-known {
allow all;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment