Created
April 13, 2016 19:11
-
-
Save donaldallen/7db7e145e48f783281f923d53abc5357 to your computer and use it in GitHub Desktop.
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; | |
listen 80; | |
# listen on both hosts | |
server_name donaldallen.com www.donaldallen.com; | |
# and redirect to the https host (declared below) | |
# avoiding http://www -> https://www -> https:// chain. | |
return 301 https://www.donaldallen.com$request_uri; | |
} | |
server { | |
listen [::]:443 ssl; | |
listen 443 ssl; | |
# listen on the wrong host | |
server_name donaldallen.com; | |
include h5bp/directive-only/ssl.conf; | |
# and redirect to the non-www host (declared below) | |
return 301 https://www.donaldallen.com$request_uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment