Skip to content

Instantly share code, notes, and snippets.

@Noisyfox
Last active March 1, 2018 11:19
Show Gist options
  • Save Noisyfox/41053a83d858099b057a87af1e35f4e8 to your computer and use it in GitHub Desktop.
Save Noisyfox/41053a83d858099b057a87af1e35f4e8 to your computer and use it in GitHub Desktop.
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name yoursite.com www.yoursite.com;
location /{
rewrite ^(.*) https://$host$request_uri permanent;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2 ipv6only=on;
server_name yoursite.com www.yoursite.com;
ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;
ssl_session_cache shared:le_nginx_SSL:1m;
ssl_session_timeout 1440m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-CHACHA20-POLY1305-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:RSA-AES128-GCM-SHA256:RSA-AES256-GCM-SHA384:RSA-AES128-SHA:RSA-AES256-SHA:RSA-3DES-EDE-SHA";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
# Your site specific config starts here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment