Skip to content

Instantly share code, notes, and snippets.

Forked from konklone/ssl.rules
Created May 20, 2014 22:15
Show Gist options
  • Save be/4c1c8c8698c4ded05b04 to your computer and use it in GitHub Desktop.
Save be/4c1c8c8698c4ded05b04 to your computer and use it in GitHub Desktop.
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
# the .crt may omit the root CA cert, if it's a standard CA that ships with clients.
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;
# nginx 1.5.9+ ONLY
ssl_buffer_size 1400; # 1400 bytes to fit in one MTU
# SPDY header compression (0 for none, 1 for fast/less compression, 9 for slow/heavy compression)
spdy_headers_comp 6;
# OCSP stapling - means nginx will poll the CA for signed OCSP responses,
# and send them to clients so clients don't make their own OCSP calls.
# while the ssl_certificate above may omit the root cert if the CA is trusted,
# ssl_trusted_certificate below must point to a chain of all certs
# in the trust path - (your cert, intermediary certs, root cert)
# below is Google's public DNS server. nginx will use it to talk to the CA.
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /path/to/all-certs-in-chain.crt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment