Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
server {
listen 80;
return 301 https://$host$request_uri;
# optional: the 'spdy' at the end of the listen command below turns on SPDY support.
server {
listen 443 ssl spdy;
# required: path to certificate and private key
ssl_certificate /path/to/unified.crt;
ssl_certificate_key /path/to/my-private-decrypted.key;
# optional: tell browsers to require SSL (warning: difficult to change your mind)
add_header Strict-Transport-Security max-age=31536000;
# optional: prefer certain ciphersuites, to enforce Perfect Forward Secrecy and avoid known vulnerabilities.
# done in consultation with:
ssl_prefer_server_ciphers on;
# optional: turn on session resumption, using a 10 min cache shared across nginx processes
# as recommended by
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
keepalive_timeout 70;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.