Welcome! Log In Create A New Profile

Advanced

Re: $ancient_browser - always 1?

Jeffrey 'jf' Lim
March 23, 2011 06:40AM
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
http://kerneltrap.org/node/7228


On Wed, Mar 23, 2011 at 4:37 PM, Jeffrey 'jf' Lim <jfs.world@gmail.com>wrote:

> 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
> http://kerneltrap.org/node/7228
>
>
> On Wed, Mar 23, 2011 at 3:33 PM, Jeffrey 'jf' Lim <jfs.world@gmail.com>wrote:
>
>> 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 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;
>> }
>> ========
>>
>> 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 (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
>> http://kerneltrap.org/node/7228
>>
>
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

$ancient_browser - always 1?

Jeffrey 'jf' Lim March 23, 2011 03:34AM

Re: $ancient_browser - always 1?

Jeffrey 'jf' Lim March 23, 2011 04:38AM

Re: $ancient_browser - always 1?

Jeffrey 'jf' Lim March 23, 2011 06:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready