Skip to content

Instantly share code, notes, and snippets.

@stephanie-gredell
Created March 20, 2015 08:43
Show Gist options
  • Save stephanie-gredell/0bdbcc878002956a417f to your computer and use it in GitHub Desktop.
Save stephanie-gredell/0bdbcc878002956a417f to your computer and use it in GitHub Desktop.
Redirect HTTP to HTTPS using nginx
server {
listen 80;
servername server.com;
return 301 https://$servername$requesturi;
}
server {
listen 443 ssl;
servername server.com;
sslcertificate /path/to/ssl/cert.pem;
sslcertificate_key /path/to/ssl/key.pem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment