Last active
November 11, 2015 19:05
-
-
Save rcotrina94/341fbf6bb2f285ba551c to your computer and use it in GitHub Desktop.
[Nginx] Redirect www to no-www for multiple server names.
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; | |
server_name ~^(?!www\.)(?<domain>.+)$; | |
return 301 $scheme://$domain$request_uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment