Hi ![]()
-
Your
reverse_proxyupstream (127.0.01vs127.0.0.1) is a bit odd (typo?), but will work just fine because of different IP representations (IP zero suppression and zero compression in this case).
While it does work, I’d recommend changing it to127.0.0.1anyway. -
2 of those 4
@namedMatcherare still equal. Prefixing the name of a@namedMatcherwithnot(@not_namedMatcher) will only change the name and nothing else.
If you want@not_findprovsto not match the paths of@findprovsyou would need to prefix thepathwithnot:@findprovs { path /api/v0/dht/findprovs method POST header_regexp Referer (domainB) } @not_findprovs { - path /api/v0/dht/findprovs + not path /api/v0/dht/findprovs method POST header_regexp Referer (domainB) }But please see Request matchers (Caddyfile) — Caddy Documentation
And as @francislavoie already wrote: -
@matt did an amazingly extensive explanation about directive order in
Caddyfiles here:
Composing in the Caddyfile
I can assure you this will help you understand how matchers and ordering works!
So please consider reading it and use somehandle {}s and maybe post your newCaddyfileagain, if you have any remaining questions
-
And relying on the referrer (
Refererheader) for any kind of security is an awful idea. Trivially easy to overcome as a “bad actor” and some browser may not even send that header at all, which would render them incompatible with your site.