-
-
Save EdwardNavarro/129664e748bcb2bc1cecaa127e892715 to your computer and use it in GitHub Desktop.
Redirect old-classic browser including IE 11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
map $http_user_agent $outdated { | |
default 0; | |
"~MSIE [1-10]\." 1; | |
"~Trident/[5-7]\." 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; | |
} | |
server { | |
listen 80; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
if ($outdated = 1) { | |
rewrite ^ /outdated.html redirect; | |
} | |
} | |
location = /outdated.html { | |
root /usr/share/nginx/html; | |
index outdated.html; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment