Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4726

Use_backend with cookie / map

$
0
0

@bd76 wrote:

hi,
I am routing to a backend if a certain cookie exists in the request.
The following works just fine:

acl has_cookie req.cook(lacan_xyz) -m found
use_backend canary_backend if has_cookie

Ideally I would like to use a map definition to avoid having to restart haproxy if/when the cookie name or value changes (from my understanding, making changes to map files can work without a restart). For example:

use_backend %[req.cook(lacan_xyz), map(/etc/haproxy/map_file.map, default_backend)]

In map_file.map, the key would be the cookie value and the value would be the name of a backend definition.

Attempting to do this results in a warning, and my desired functionality not working.

The warning:
Starting haproxy: [WARNING] 115/173343 (16970) : parsing [/etc/haproxy/haproxy.cfg:57] : Ignoring end of truncated ‘acl’ line after ‘req.cook(lacan_xyz),’

The haproxy version being used:
HA-Proxy version 1.6.1 2015/10/20

any insight or suggestions would be most appreciated,
thank you

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4726

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>