Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 1 | # |
| 2 | # This is an example of how to configure HAProxy to be used with WURFL Device Detection module. |
| 3 | # |
| 4 | # HAProxy needs to be compiled with support for this. See README section 1.3 |
| 5 | # |
| 6 | |
| 7 | global |
| 8 | |
| 9 | # The WURFL data file |
paulborile | bad132c | 2019-04-18 11:57:04 +0200 | [diff] [blame] | 10 | wurfl-data-file /usr/share/wurfl/wurfl.zip |
Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 11 | |
| 12 | # WURFL patches definition (as much as needed, patches will be applied in the same order as specified in this conf file) |
| 13 | #wurfl-patch-file /path/to/patch1.xml; |
| 14 | |
Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 15 | #wurfl-cache-size 100000 |
| 16 | ## no cache |
| 17 | #wurfl-cache-size 0 |
| 18 | |
| 19 | wurfl-information-list-separator | |
| 20 | |
| 21 | # list of WURFL capabilities, virtual capabilities, property names planned to be used in injected headers |
| 22 | wurfl-information-list wurfl_id model_name |
| 23 | |
| 24 | defaults |
| 25 | mode http |
| 26 | timeout connect 30s |
| 27 | timeout client 30s |
| 28 | timeout server 30s |
| 29 | |
| 30 | frontend TheFrontend |
| 31 | bind 192.168.1.22:80 |
| 32 | default_backend TheBackend |
| 33 | |
Ilya Shipitsin | 47d1718 | 2020-06-21 21:42:57 +0500 | [diff] [blame] | 34 | # inject a header called X-Wurfl-All with all the WURFL information listed in wurfl-information-list |
Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 35 | http-request set-header X-Wurfl-All %[wurfl-get-all()] |
| 36 | |
| 37 | # inject a header called X-WURFL-PROPERTIES with the "wurfl_id" information (should be listed in wurfl-information-list) |
| 38 | #http-request set-header X-WURFL-PROPERTIES %[wurfl-get(wurfl_id)] |
| 39 | |
| 40 | backend TheBackend |
| 41 | server TheWebServer 192.168.0.40:80 |