Seocheckout

How to redirect URLs in nginx?



Write the reason you're deleting this FAQ

How to redirect URLs in nginx?

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?

Comments

Please login or sign up to leave a comment

Join
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;



Are you sure you want to delete this post?