Created
March 24, 2017 11:26
-
-
Save janneleppanen/1edb6389c95d0f60deaef2db7e50255f to your computer and use it in GitHub Desktop.
NGINX redirect sub folder to new subdomain
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 sub folder to new sub domain | |
location ~ /sub { | |
rewrite ^(/sub/)(.*)$ http://sub.domain.com/$2; | |
} | |
# redirect main site to new domain | |
location ~ / { | |
return 302 http://domain.com$request_uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment