Skip to content

Instantly share code, notes, and snippets.

@codegirl-007
Created March 20, 2015 08:43
Show Gist options
  • Save codegirl-007/0bdbcc878002956a417f to your computer and use it in GitHub Desktop.
Save codegirl-007/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