Answer the question
In order to leave comments, you need to log in
How to write a redirect depending on the browser in Nginx?
Hi all!
How do I redirect to nginx. The bottom line is, if the Opera browser - we do a redirect.
I try to write like this:
map $http_user_agent $outdated {
default 0;
"~Opera.*Version/[0-9]\." one;
}
if ($outdated = 1){
rewrite ^ /outdated redirect;
}
This does not work in the server section, I cannot declare the http section in the virtual host.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question