How do I redirect outdated browsers with an Nginx map?
-
0 http://... http://stackoverflow.com/questions/23460195/how-to-redirect-outdated-browsers-with-nginx-map# We have an NginX balancing proxy in front of our web application. Unfortunately there is not enough development resources to support outdated browsers, yet :( We want to redirect members of our web project to /outdated page by their browser user-agent data like this (https://www.in2circle.com/outdated). For some reason we don't want to load back-end with User-Agent content analysis logic. I've heard it's easy to do with NginX http://nginx.org/en/docs/http/ngx_http_map_module.htmlIf somebody did so, can you help me with examples and explanations, please!
-
Answer:
Next solution works pretty good and is exactely what I wanted: map $http_user_agent $outdated { default 0; "~MSIE [1-9]\." 1; "~Mozilla.*Firefox/[1-9]\." 1; "~Mozilla.*Firefox/[0-2][0-9]\." 1; "~Mozilla.*Firefox/3[0-1]\." 1; "~Opera.*Version/[0-9]\." 1; "~Opera.*Version/[0-1][0-9]\." 1; "~Opera.*Version/2[0-1]\." 1; "~AppleWebKit.*Version/[0-6]\..*Safari" 1; "~Chrome/[0-9]\." 1; "~Chrome/[0-2][0-9]\." 1; "~Chrome/3[0-3]\." 1; } if ($outdated = 1){ rewrite ^ /outdated redirect; } Thanks everyone for Help/Answers.
Alexander Arutinyants at Quora Visit the source
Related Q & A:
- How do I redirect all posts from the old Wordpress to a subdomain?Best solution by en.support.wordpress.com
- How can I redirect www to non www site?Best solution by Server Fault
- How to I redirect URLS with special characters in htaccess?Best solution by Server Fault
- How can I do nginx rewrite?Best solution by Server Fault
- How do I redirect emails?Best solution by wikihow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.