Last active
January 27, 2016 13:45
-
-
Save phroggyy/859f2b59dc8a86eca331 to your computer and use it in GitHub Desktop.
redirect all http requests and www.* requests to https://host.name/ Credit to @jaw-sh for the script
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443; | |
listen [::]:443; | |
server_name "~^www\.(.*)$" ; | |
return 301 https://$1$request_uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment