• About Us
  • Blog
  • Basket
  • Account
  • Sign In


51Degrees NGINX Module

Published on Wednesday, June 29, 2016

51Degrees NGINX Module

The new NGINX module has now been released as beta


NGINX is a load balancing reverse proxy which is written to be very fast. It is used mainly in systems that see a lot of traffic and need to route requests to multiple servers, but has been used in a wide variety of systems as well.

The new 51Degrees NGINX module combines patented device detection with the simplicity of NGINX. Detection can be carried out on an NGINX load balancing server with just one line in the configuration and installation requires no changes to the existing web server implementation. With all the work being done in NGINX’s request cycle, the properties of the device are simply passed to the web server as additional HTTP headers. As well as User-Agent matching, the module supports multiple HTTP header matching with no extra code in order to catch tricky browsers like Opera Mini.

A simple example of how the module can be seen below.


http { Server { Location / { 51D_match_all x-device DeviceType,PlatformName,HardwareName; 51D_match_all x-metrics DeviceId,Method,Rank; ... } } } 


Here the two headers are added to all incoming requests. The first header “x-device” contains information about the device, the second “x-metrics” contains match metrics indicating the accuracy of the match, and the popularity of the device.

Carrying out device detection in this way makes web optimisation easier by removing the need for any software integration on an existing website. All that is needed is an “if” statement such as “if tablet” or “if smartphone”. The time penalty for a request when using the 51Degrees NGINX module is as little as 0.001 ms on an i7 or similar processor.

Full benchmarking results can be found at https://51Degrees.com/Support/Documentation/APIs/C-V32/Benchmarks.

Full installation, test, and usage instructions can be found at https://github.com/51Degrees/Device-Detection/tree/master/nginx.

Comments (0)

Author: Ben Shillito

Categories: Development, News

Tags: C , NGINX , Module , Server

Ben Shillito

Ben Shillito

Other posts by Ben Shillito
Contact author



.NET 2013 2014 4G 51Degrees 5G A.C.Roma A7 ABI Acer Adtech Affiliate Marketing Afilias Alcatel Amazon AMP Analysis Analytics Android Android 5.0 Lollipop Android Kitkat Android Lollipop Android Media Stick Apache API Apple Apple TV Archos Asha Asian Market ASP.NET Asus Australia Big Data Black Friday Blackberry Blink Browser C C# Case Study CeBIT CES Chrome Cloud CMS combinations Comparison Competition CoolPad COTW Cron CSS3 Data Data Blog Data File Data Model Daydream Denver Design Desire Eye Desktop Detection Developers Device Device Data Device Detection Device Intelligence Device Popularity Device property Device Types Device Use DeviceAtlas Display dmexco DoCoMo Doogee DotNetNuke Download Drupal Email EReader E-Reader Ericsson Evaluation Event Examples EXPLAY Rio Facebook feature Firefox Firefox OS Fly Foundation Framework France Galaxy S3 Galaxy S5 Galaxy Tab A Galaxy Tab A 8.0 Galaxy Tab A 9.7 Germany git repositories Global Google Google Daydream GSMA HAProxy Hardware Hisense HTC HTC ONE MAX HTC OS HTML5 HTTP HTTP Headers Huawei HUAWEI. UPDATE HUDL Huwaei IBC Icemobile Prime 4.0 IE IFA IIS Image Optimiser Image Optimizer India Infographic Ingeniux Internet usage iOS iOS 7 iOS 8 ipad iPhone iPhone 6 IsEmailBrowser IsWebApp Italy Japan Java Javascript Jolla Kentico Keynote Kindle Kindle Fire Kindle Fire HD Leagoo Lenovo LG Location Log File Analysis LTE Lumia m.dot macOS Map Memory Meta Data Mi 4S Micromax Microsoft Miia Style Mobile Mobile Analysis Mobile Analytics Mobile Devices Mobile Marketing Mixer Module Motorola MVC4 MWC MWC 2017 MWC16 MyPhone Native Native Apps NET New Release News News Letter Nexus Nexus 6 Nexus 9 NFC NGINX Nokia Nokia 3310 Non-Mobile NVIDIA Omate On7 OnePlus 5 Opera Opera Mini Operating System Optimisation OS OSX 10.10 OTA Panasonic Patent PC Pebble Performance phablet phone PHP Poland Presentation Press Release Price Band PRIV programmatic PS4 Publishers Python QMobile QR Codes Redirection Research Reseller Responsive Images Responsive web design RESS Review reviews RIM Ringmark RTB RWD Safari Samsung Scala ScientiaMobile Screen Screen resolution Screen Size SEO Server Server-side optimisation Set Box Set Top Box Sharepoint Shark 1 SHIFT phones Sitecore Sitecore version 9 SLUSH Smart TV Smartphone Smartphones Smartwatches Snapdragon Sony Sony Xperia Spain Swedish Beers Symbian Tablet Tablets Tesco Testing Tips Top 5 TOTW Tutorial TV UDS UK Umbraco Update updates US User Agent UserAgent User-Agent Vendors Version 3 Video VoLTE VR Wearable Web Web Apps Web content management WebKit WebMatrix White Paper Widgets Widnows WiFi Wiko Wileyfox Windows Windows Phone WURFL Xbox XBox One Xiaomi Xperia Xperia z Yosemite Z10 ZenFon 2 ZOPO ZTE