Skip to content

Instantly share code, notes, and snippets.

@meineerde
Last active December 21, 2017 14:47
Show Gist options
  • Save meineerde/c91a862d95446ef8a494dbafef776354 to your computer and use it in GitHub Desktop.
Save meineerde/c91a862d95446ef8a494dbafef776354 to your computer and use it in GitHub Desktop.
HAPROXY: Get the equivalent of a fullbase fetch, that is the concatenation of the host header, the path, and the query string
# Build a new (internal) header containing the required full-base data
# Unfortunately, we can't use variables here since they can't be used to concat data
http-request set-header X-Full-Base %[base]
http-request set-header X-Full-Base %[base]?%[query] if { query -m found }
http-request deny if { req.hdr(X-Full-Base),map(/path/to/url_list.txt) -m found }
# cleanup
http-request del-header X-Full-Base
@nublaii
Copy link

nublaii commented Dec 21, 2017

# you can replace the first 2 lines with this one

http-request set-header X-Full-Base %[base]%HQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment