Quantcast
Channel: Serverphorums.com - HAProxy
Viewing all articles
Browse latest Browse all 5112

unique-id-header and req.hdr (no replies)

$
0
0
I'm trying generate a unique-id-header only if one is not already provided
in the request. If I provide the header in my request to haproxy I end up
with duplicate headers, one with auto generated header and another with the
user provided header. I attempted to use the technique mentioned here (
http://discourse.haproxy.org/t/unique-id-adding-only-if-header-not-present/67/2)
and listed below but it is not working for me. Basically, I'm unable to
check/get value for unique-id-header (e.g. req.hdr(TMP-X-Request-Id)). Any
ideas?

frontend public
bind *:80
unique-id-format %{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid
unique-id-header TMP-X-Request-Id
default_backend ui

backend ui
http-request set-header X-Request-Id %[req.hdr(TMP-X-Request-Id)]
unless { req.hdr(X-Request-Id) -m found }
http-request del-header TMP-X-Request-Id

Viewing all articles
Browse latest Browse all 5112

Trending Articles