Jay Taylor's notes
back to listing indexMatch regex/wildcard against http header NAMES in haproxy - Stack Overflow
[web search]-
-
Home -
Questions -
-
Tags -
Saves -
Users -
Companies -
Labs
-
Jobs
-
Discussions -
Communities for your favorite technologies. Explore all Collectives
-
-
Teams
Now available on Stack Overflow for Teams! AI features where you work: search, IDE, and chat.
Learn more Explore Teams -
Looking for
I'd like to add an acl rule to capture the existence of a header name that matches the following regex: ^X-w+-Signature
(or whatever wildcard). Examples to match:
X-Abc-Signature
X-Whatever-Signature
X-Service-Signature
I know I could explicitly create rules like:
acl has_abc_token req.fhdr(X-Abc-Signature) -m found
acl has_whatever_token req.fhdr(X-Whatever-Signature) -m found
acl has_service_token req.fhdr(X-Service-Signature) -m found
Is it even possible to do this in haproxy?
Also, it's my understanding is that the w
character class does not exist in haproxy?
It looks like req.hdr_names()
might be what I'm looking for, but I'm at a loss at how to use it.
1 Answer
Nevermind. I figured it out:
acl has_sig req.hdr_names() -m reg -i ,X-[A-Za-z]+-Signature
Your Answer
Not the answer you're looking for? Browse other questions tagged or ask your own question.
- Featured on Meta
-
-
Related
Hot Network Questions
- Have the results of any U.S. presidential election other than 2000, 2020 been widely disputed and litigated?
- How can life which cannot live on the surface of a planet naturally reach the supermajority of the planet's caves?
- Can a publication license for one figure be different than the whole article's license?
- Is it dangerous if an LED lightbulb fails to light up?
- adjective as a noun