Configuring the Nginx API
Before you start matching user agents, you may wish to configure the solution to use a different database for example, or to use caching.
General Settings - These settings are valid in the main configuration block and should only be set once.
Setting | Default | Description |
---|---|---|
51D_filePath | '51Degrees.dat'/'51Degrees.trie' | Sets the location of the data file. |
51D_cache | 0 | Sets the size of the workset cache (Only relevant for pattern installation). |
Location Settings - These settings are valid in the location configuration block and any number can be set.
Setting | Description |
---|---|
51D_single | Gets device properties using a User-Agent. Takes the name the resultant header will be set as, and a comma separated list of properties to return. |
51D_all | Gets device properties using multiple HTTP headers. Takes the name the resultant header will be set as, and a comma separated list of properties to return. |
Example Config
Below is an example config file showing how to load a Patter data file from a non default location, set the cache size, and set some device properties using the "51D_single" and "51D_all" directives. Some commonly used properties are set as request headers, some as a list and some as single headers. They are also set as response headers with the "add_header" directive to make it possible to see how the matching works without having a full website set up.