Skip to content

Instantly share code, notes, and snippets.

@tim-peterson
Created July 22, 2013 20:24
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 tim-peterson/6057327 to your computer and use it in GitHub Desktop.
Save tim-peterson/6057327 to your computer and use it in GitHub Desktop.
Make https mandatory without 301 redirect on Nginx using Strict-Transport-Security
http{
server {
listen 443 ssl;
ssl on;
ssl_certificate /etc/ssl/my_site.pem;
ssl_certificate_key /etc/ssl/my_site.key;
server_name my_site.com;
add_header Strict-Transport-Security "max-age=262974383";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment