# $ancient\_browser - always 1?

**URL:** <https://www.ruby-forum.com/t/ancient-browser-always-1/204850>\
**Category:** NGINX\
**Created:** [March 23, 2011, 8:33am UTC](https://www.ruby-forum.com/t/ancient-browser-always-1/204850 "2011-03-23T08:33:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 23, 2011, 8:33am UTC](https://www.ruby-forum.com/t/ancient-browser-always-1/204850/1 "2011-03-23T08:33:30Z")

</div>

as per subject, I’m playing around with the http browser module right  
now,  
and I just can’t seem to get it to work.

[http://wiki.nginx.org/HttpBrowserModule](http://wiki.nginx.org/HttpBrowserModule) itself seems confused as well.  
In  
the first part (“Selection of the index file”), it uses the format  
‘modern\_browser msie 5.5’ - while in Examples, this format is pointed  
out as  
broken.

Either way - I’m expecting for the value of $ancient\_browser to only be  
set  
when nginx actually detects an ancient browser as set up by the  
‘ancient\_browser …’ lines. However, it seems that even without  
specifying  
any ancient\_browser lines, the $ancient\_browser value is set?

# to show a snippet of my nginx.conf:

# location / { if ($ancient\_browser) { redirect .\* /${ancient\_browser}.html redirect; } proxy\_pass [http://127.0.0.1:1000](http://127.0.0.1:1000); }

This triggers the redirect no matter what - FF3, MSIE 7, MSIE 8, …

Am i doing anything wrong here? I’m using nginx 0.8.54, compiled from  
[nginx.org](http://nginx.org) (and I havent disabled the http browser module)

thanks,  
-jf

–  
“Every nonfree program has a lord, a master –  
and if you use the program, he is your master.”  
–Richard Stallman

“It’s so hard to write a graphics driver that open-sourcing it would not  
help.”  
– Andrew Fear, Software Product Manager, NVIDIA Corporation

> **[An Interview With Linus Torvalds: Linux and Git - Part 1 30 Years Of Linux](https://www.tag1consulting.com/blog/interview-linus-torvalds-linux-and-git)**
>
> Thirty years ago, Linus Torvalds was a 21 year old student at the University of Helsinki when he first released the Linux Kernel. His announcement started, “I’m doing a (free) operating system (just a hobby, won't be big and professional…)”. Three...

---

<div class="post-metadata">

**Author:** ![jfl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jfl](https://www.ruby-forum.com/u/jfl)\
**Post date:** [March 23, 2011, 9:38am UTC](https://www.ruby-forum.com/t/ancient-browser-always-1/204850/2 "2011-03-23T09:38:01Z")

</div>

ok, a quick update after having glanced through the source - you’ll need  
to  
set BOTH ‘modern\_browser’, and ‘ancient\_browser’ (otherwise, u’ll just  
hit  
into major frustration - like i did). The ‘modern\_browser’ format is as  
per  
the examples, and the doc, while ‘ancient\_browser’ has to follow the  
format  
as given in ‘Examples’.

-jf

–  
“Every nonfree program has a lord, a master –  
and if you use the program, he is your master.”  
–Richard Stallman

“It’s so hard to write a graphics driver that open-sourcing it would not  
help.”  
– Andrew Fear, Software Product Manager, NVIDIA Corporation

> **[An Interview With Linus Torvalds: Linux and Git - Part 1 30 Years Of Linux](https://www.tag1consulting.com/blog/interview-linus-torvalds-linux-and-git)**
>
> Thirty years ago, Linus Torvalds was a 21 year old student at the University of Helsinki when he first released the Linux Kernel. His announcement started, “I’m doing a (free) operating system (just a hobby, won't be big and professional…)”. Three...

---

<div class="post-metadata">

**Author:** ![jfl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jfl](https://www.ruby-forum.com/u/jfl)\
**Post date:** [March 23, 2011, 11:40am UTC](https://www.ruby-forum.com/t/ancient-browser-always-1/204850/3 "2011-03-23T11:40:14Z")

</div>

a little bit more detail. This supercedes what I said about having to  
set  
both ‘modern\_browser’, and ‘ancient\_browser’. But

- modern\_browsers are matched for the browser first, and then the  
version  
number. UA number \>= ‘modern\_browser’ version number = modern browser.  
Otherwise, it’s an ancient browser.

- ‘ancient\_browser’ values are literal strings that you must match for  
in  
the user-agent

- if you have ‘modern\_browser unlisted’, any browser that isnt caught by  
any  
other ‘modern\_browser’ directive, or matched by any ‘ancient\_browser’  
values  
is automatically a “modern browser”.

- if you DONT have ‘modern\_browser’, whatever falls through the cracks  
will  
automatically be declared an “ancient browser” (this was what tripped me  
up  
originally)

-jf

–  
“Every nonfree program has a lord, a master –  
and if you use the program, he is your master.”  
–Richard Stallman

“It’s so hard to write a graphics driver that open-sourcing it would not  
help.”  
– Andrew Fear, Software Product Manager, NVIDIA Corporation

> **[An Interview With Linus Torvalds: Linux and Git - Part 1 30 Years Of Linux](https://www.tag1consulting.com/blog/interview-linus-torvalds-linux-and-git)**
>
> Thirty years ago, Linus Torvalds was a 21 year old student at the University of Helsinki when he first released the Linux Kernel. His announcement started, “I’m doing a (free) operating system (just a hobby, won't be big and professional…)”. Three...
