Created
January 8, 2019 21:53
-
-
Save anderfernandes/88cb2888c57fc3d88f904f0a88e524fb to your computer and use it in GitHub Desktop.
nginx http redirect to https (whole server instance)
This file contains 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
# Redirect HTTP request to HTTPS | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
return 301 https://$host$request_uri; | |
} | |
# HTTPS settings | |
server { | |
listen 443 default_server; | |
... # the rest of the standard HTTPS configuration | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment