Mobile browser detection at server level

Just wonder if anyone’s been doing anything with detecting mobile
browsers
at the nginx level.

Something like wurfl can be great through PHP, but if you’re serving
static cached versions, the PHP doesn’t get hot for that user.

Any way to integrate something like wurfl at the server level?

On 3/18/11 4:53 PM, “Ian M. Evans” [email protected] wrote:

Any way to integrate something like wurfl at the server level?

For us, we just care about if the browser is mobile or not, so we just
use a
nasty regex with a redirect. The mobile site does the full wurfl like
detection.


Brian A.

On Fri, March 18, 2011 4:55 pm, Akins, Brian wrote:

For us, we just care about if the browser is mobile or not, so we just use
a
nasty regex with a redirect. The mobile site does the full wurfl like
detection.

Great way to handle it.

Is there a good regex you’d recommend?

It is perfectly possible to do so with nginx server level configuration,
I wrote a blogpost about it on my blog:
http://blog.andrieslouw.nl/2012/01/serving-mobile-users-with-nginx.html

I’m not exactly sure if it follows all the best-practices, but it seems
to work quite well in my enviroment.


Andries Louw Wolthuizen

Posted at Nginx Forum:

António P. P. Almeida Wrote:

There’s a simpler and more efficient way to do it.
Instead of
detecting the mobile browser, do the
complementary, i.e. detect the
desktop browser:

1326701’s gists · GitHub

— appa

I’d like to warn you about that one, it detects bot’s like Googlebot
also as being an mobile device. My setup does also detect desktop
browsers first, as you may or may not have seen. So it’s the same setup,
but mine has more exclusions to the “desktop” list.


Andries Louw Wolthuizen

Posted at Nginx Forum:

We use some Lua that’s basically a combination of the posted links. It
catches the edge cases a little better. Some things are just easier to
do in a “real” programming language.

–Brian

On 7 Jan 2012 13h49 WET, [email protected] wrote:

It is perfectly possible to do so with nginx server level
configuration, I wrote a blogpost about it on my blog:
http://blog.andrieslouw.nl/2012/01/serving-mobile-users-with-nginx.html

I’m not exactly sure if it follows all the best-practices, but it
seems to work quite well in my enviroment.

There’s a simpler and more efficient way to do it. Instead of
detecting the mobile browser, do the complementary, i.e. detect the
desktop browser:

— appa

We found most of the “packaged” detection libraries/databases very, very
slow. It’s hard to beat the performance of Lua embedded in nginx.

–Brian

Handset Detection has a good solution when it comes to detection and
redirection. There is also a new detection system coming out that allows
you to run the detection either from your server or HD’s. API kits are
currently available for PHP, Ruby, Coldfusion, ASP.net, Java and Python.

Posted at Nginx Forum:

Hi, my name is Luca Passani and I am the WURFL creator.

Pardon my jumping into a old thread, but the NGINX module ScientiaMobile
(my
company) released today nicely addresses the question of the original
poster.

More information available here:

Thanks

Luca Passani
CTO @ScientiaMobile

Posted at Nginx Forum: