Answer the question
In order to leave comments, you need to log in
How to make a dynamic redirect in nginx?
Hey!
Please tell me how to set up a dynamic redirect in nginx, so that what comes after some given url redirects to the main page. Tried like this -
location = /products(.*)$ { rewrite ^ http://site.ru/ permanent; }
Answer the question
In order to leave comments, you need to log in
At least - a tilde instead of an equal sign, if you want to set the location with a regular expression
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question