public
Last active

  • Download Gist
browsers.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#
# Supported browsers
#
 
modern_browser gecko 1.9;
 
# note that Safari related directives match
# Chrome, Mobile Safari, Palm Pre and other WebKit-based browsers here, too, thanks
# to all of them using almost identical User-Agent strings
modern_browser safari 3.0;
modern_browser safari 3.1;
modern_browser safari 3.2;
modern_browser safari 4.0;
 
modern_browser msie 7.0;
modern_browser msie 8.0;
 
modern_browser unlisted;
 
#
# Non-supported browsers
#
 
ancient_browser msie 4.0;
ancient_browser msie 5.0;
ancient_browser msie 5.5;
ancient_browser msie 6.0;
 
# Here is how one can disable support of a specific browser
ancient_browser opera 7;
ancient_browser opera 8;
ancient_browser opera 9;
ancient_browser opera 10;
 
ancient_browser konqueror 3;
ancient_browser konqueror 4;
 
ancient_browser Links Lynx Netscape4;
 
#
# Now, to the fun part. If we perform a rewrite on every
# request here, images won't be displayed, so we have to
# do some extra work besides just
#
# if ($ancient_browser){
# rewrite ^ /unsupported_browser.html;
# break;
# }
 
set $unsupported_browser_rewrite do_not_perform;
 
if ($ancient_browser){
set $unsupported_browser_rewrite perform;
}
 
if ($uri !~* /\.(jpeg|jpg|png|ico|gif|js|css)$/) {
set $unsupported_browser_rewrite do_not_perform;
}
 
if ($unsupported_browser_rewrite = perform){
rewrite ^ /unsupported_browser.html;
break;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.