Created
July 17, 2018 22:47
-
-
Save evemilano/19240112df4666a6c9f7ecf3dc867160 to your computer and use it in GitHub Desktop.
Nginx HTTP to HTTPS 301 redirect
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
#blocco di redirect HTTP | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
server_name www.evemilano.com evemilano.com; | |
return 301 https://www.evemilano.com$request_uri; | |
} | |
#blocco di redirect IP | |
server { | |
listen 80; | |
server_name 82.196.0.237; | |
return 301 $scheme://www.evemilano.com$request_uri; | |
} | |
#blocco default HTTPS | |
server { | |
# Gestione SSL | |
listen 443 ssl; | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Guida completa: https://www.evemilano.com/redirect-www-not-www/