Hi,
I'm trying to detect users' browser version then proxy to a certain page.
I've read http://wiki.nginx.org/HttpBrowserModule#Examples and came up with the following configuration
server {
listen 83;
server_name {my ip goes here}
location / {
ancient_browser "MSIE 6.0";
if ($ancient_browser){
rewrite ^ /ie6 break;
}
proxy_pass http://localhost:34881 ;
proxy_set_header Host $host ;
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header Country $geoip_country_code;
proxy_cache cache;
proxy_cache_valid 200 302 1h;
proxy_cache_valid 404 1m;
add_header Pragma no-cache;
expires epoch;
if_modified_since off;
add_header Last-Modified "";
}
The problem with this code is that I get an infinity loop.
How do I display http://localhost:34881/ie6 if a user is using ie6 ?