]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: deviceatlas: more example use cases.
authorDavid Carlier <dcarlier@afilias.info>
Wed, 28 Oct 2015 11:08:15 +0000 (11:08 +0000)
committerWilly Tarreau <w@1wt.eu>
Sun, 1 Nov 2015 19:47:54 +0000 (20:47 +0100)
In addition of adding additional headers examples, some examples of
defining an ACL.

README

diff --git a/README b/README
index cf976057bc87e5250d39d1fb55d457eb88edfa4d..a99b845ffbe5d10510ad753a39c49fe167c7d18f 100644 (file)
--- a/README
+++ b/README
@@ -251,23 +251,33 @@ Sample configuration :
 
 There are two distinct methods available, one which leverages all HTTP headers
 and one which uses only a single HTTP header for the detection. The former
-method is highly recommended and more accurate.
+method is highly recommended and more accurate. There are several possible use
+cases.
 
+# To transmit the DeviceAtlas data downstream to the target application
 
-All HTTP headers
+All HTTP headers via the sample / fetch
+
+    http-request set-header X-DeviceAtlas-Data %[da-csv-fetch(primaryHardwareType,osName,osVersion,browserName,browserVersion)]
 
+Single HTTP header (e.g. User-Agent) via the convertor
 
-      http-request set-header X-DeviceAtlas-Data %[da-csv-fetch(primaryHardwareType,osName,osVersion,browserName,browserVersion)]
+    http-request set-header X-DeviceAtlas-Data %[req.fhdr(User-Agent),da-csv-conv(primaryHardwareType,osName,osVersion,browserName,browserVersion)]
 
+# Mobile content switching with ACL
 
-Single HTTP header (e.g. User-Agent)
+All HTTP headers
 
+    acl is_mobile da-csv-fetch(mobileDevice) 1
 
-      http-request set-header X-DeviceAtlas-Data %[req.fhdr(User-Agent),da-csv-conv(primaryHardwareType,osName,osVersion,browserName,browserVersion)]
+Single HTTP header
+
+    acl device_type_tablet req.fhdr(User-Agent),da-csv-conv(primaryHardwareType) "Tablet"
 
 
 Please find more information about DeviceAtlas and the detection methods at https://deviceatlas.com/resources .
 
+
 1.2) 51Degrees Device Detection
 -------------------------------