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:
http://forum.nginx.org/read.php?2,183827,220904#msg-220904

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:

https://gist.github.com/1326701

— 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:
http://forum.nginx.org/read.php?2,183827,220909#msg-220909

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:

https://gist.github.com/1326701

— 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:
http://forum.nginx.org/read.php?2,183827,221019#msg-221019

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:

http://scientiamobile.com/blog/post/view/id/25/title/HTTP-and-Mobile%3A-The-Missing-Header-

Thanks

Luca Passani
CTO @ScientiaMobile

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,183827,231343#msg-231343

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs