So my website is working just fine, because Caddy is great as always .
However, I can see that Iām getting requests for routes like */.env
How do I straight up block / ban requests like this?
So my website is working just fine, because Caddy is great as always .
However, I can see that Iām getting requests for routes like */.env
How do I straight up block / ban requests like this?
You can achieve this with a path matcher specifying the bad paths you want to block, and a respond
directive paired with that matcher, perhaps with a status 403.
See:
https://caddyserver.com/docs/caddyfile/matchers#path
https://caddyserver.com/docs/caddyfile/directives/respond
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.