Created
March 20, 2015 08:43
-
-
Save codegirl-007/0bdbcc878002956a417f to your computer and use it in GitHub Desktop.
Redirect HTTP to HTTPS using nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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