How to redirect 301 in nginx?

April 13, 2018 5.3k views
Nginx CentOS

Hello! I need 301 redirect from to

Please help me. Thank you very much

2 Answers

Add the following to your server block in your site definition in /etc/nginx/sites-enabled

rewrite ^/watch/fadfadf1$ redirect;

Then restart nginx with:

sudo service nginx restart
Have another answer? Share your knowledge.