Forum: NGINX Mobile browser detection at server level

Posted by Ian M. Evans (Guest)
on 2011-03-18 21:54
(Received via mailing list)
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?
Posted by Akins, Brian (Guest)
on 2011-03-18 21:57
(Received via mailing list)
On 3/18/11 4:53 PM, "Ian M. Evans" <ianevans@digitalhit.com> 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 Akins
Posted by Ian M. Evans (Guest)
on 2011-03-20 22:35
(Received via mailing list)
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?
Posted by AndriesLouw (Guest)
on 2012-01-07 14:49
(Received via mailing list)
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-...

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
Posted by "António P. P. Almeida" <appa@perusio.net> (Guest)
on 2012-01-07 15:25
(Received via mailing list)
On 7 Jan 2012 13h49 WET, nginx-forum@nginx.us 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-...
>
> 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
Posted by AndriesLouw (Guest)
on 2012-01-07 15:56
(Received via mailing list)
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
Posted by Brian Akins (Guest)
on 2012-01-07 16:10
(Received via mailing list)
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
Posted by Florante (Guest)
on 2012-01-11 04:40
(Received via mailing list)
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
Posted by Brian Akins (Guest)
on 2012-01-11 04:55
(Received via mailing list)
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
Posted by passani (Guest)
on 2012-10-03 02:43
(Received via mailing list)
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/tit...

Thanks

Luca Passani
CTO @ScientiaMobile

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,183827,231343#msg-231343
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.