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

Set a cookie from a file string match

$
0
0

@chrisotherwise wrote:

Hello,

The following rules in my haproxy config search for a url fragment against lines in a text file and use the result to choose a back-end.

acl aws_path_us urlp_sub -i -f /etc/haproxy/aws_clients_us
acl aws_path_us path_sub -i -f /etc/haproxy/aws_clients_us
acl aws_referer_us req.hdr(Referer) -i -m sub -f /etc/haproxy/aws_clients_us
acl aws_cookie_us req.hdr(Cookie) -i -m sub -f /etc/haproxy/aws_clients_us

use_backend wms_cloud_us if aws_path_us or aws_referer_us or aws_cookie_us or aws_param_us

I would like to set a cookie (or a header) with the results of the match. Example:

url is: https://www.foo.com/abc123/default.html

textfile contains:

prq345
abc123
fmv592

This will match on “abc123”. I would like to set a cookie with value “abc123”. As an added bonus, I would like to set the cookie text forced to lower case regardless of the case of the URL or the text in the file.

Is either or both of these requirements possible?

Many thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4718

Trending Articles



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