Community Discussion

How to redirect URLs in nginx?

May 31, 2013
Drake83 Author Level 1

Write the reason you're deleting this FAQ

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:

redirect /user /members


Why does that not work and what is the correct way to redirect a user in nginx?
1

Comments 1

May 31, 2013
robertman11
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:
rewrite ^/user$ http://yourwebsite.com/members;

Enter a reason for deleting this comment

Please login or sign up to leave a commentJoin