worker_processes 4; load_module modules/ngx_http_51D_module.so; events { worker_connections 1024; } # // Snippet Start http { ## Set the data file for the 51Degrees module to use ## 51D_filePath ../data/51Degrees-LiteV3.2.dat; ## Enable caching with a cache size of 10000 ## 51D_cache 10000; server { listen 8888; location / { ## Do a single User-Agent match for device information ## 51D_match_single x-device HardwareName,BrowserName,PlatformName; ## Do a multiple HTTP header match for IsMobile, IsTablet and IsSmartphone ## 51D_match_all x-mobile IsMobile; 51D_match_all x-tablet IsTablet; 51D_match_all x-smartphone IsSmartPhone; ## Do a multiple HTTP header match for match metrics ## 51D_match_all x-metrics DeviceId,Method,Difference,Rank; ## Add to response headers for easy viewing. ## add_header x-device $http_x_device; add_header x-mobile $http_x_mobile; add_header x-tablet $http_x_tablet; add_header x-smartphone $http_x_smartphone; add_header x-metrics $http_x_metrics; proxy_pass http://localhost/; } } } # // Snippet End