How to redirect URLs in nginx?
May 31, 2013
I'm trying to redirect a URL in nginx using the nginx config file for my website. Here is what I have, which is not working:
Why does that not work and what is the correct way to redirect a user in nginx?
redirect /user /members
Why does that not work and what is the correct way to redirect a user in nginx?
Comments 1
May 31, 2013
You have the syntax wrong. There is no "redirect" in nginx. You use the rewrite directive. Here is how to redirect a URL in nginx using your example:
You have the syntax wrong. There is no "redirect" in nginx. You use the [B]rewrite[/B] directive. Here is how to redirect a URL in nginx using your example:
[code]rewrite ^/user$ http://yourwebsite.com/members;[/code]
rewrite ^/user$ http://yourwebsite.com/members;
Please login or sign up to leave a commentJoin
