Is there some way with nomad to check if a header is not set in a routing rule?
I think technically this should do it:
!HeadersRegexp(`x-some-header`, `.*`)
This should work because .*
should always match any value, so the only time it should be false
is if the header is not present.
But if I use this in conjunction with Path
my Traefik web console stops working.
Exact routing rule that I'm using, which seems to break the Traefik web console, is
(!HeadersRegexp(`x-some-header`, `.*`) || HeadersRegexp(`x-some-header`, `^\d+$`)) && (PathPrefix(`/api/`) || PathPrefix(`/.well-known/oauth-authorization-server`))
If I just use this, then the web console works, but it does not match if the header is not sent:
HeadersRegexp(`x-some-header`, `^\d+$`) && (PathPrefix(`/api/`) || PathPrefix(`/.well-known/oauth-authorization-server`))