alexv305
alexv305

Reputation: 1

How do I block a path in traefik?

How do I block a path in traefik?

For example, I created an IP whitelist middleware which works correctly and when applied blocks any domain I want using: **rule = Host(domain.com) ** and also blocks a path such as: **rule = "Host(example.com) || (Host(example.org) && Path(/traefik))" ** But when I visit 'example.com//traefik' it bypasses the middleware and I can access the page. If I go to /traefik the IP whitelist middleware blocks the page as intended.

Note the // double fowardslash in the path, how do I block access to //traefik and ///traefik, etc. The actual path I need to block is /xmlrpc.php, I'm seeing many requests going to //xmlrpc.php bypassing the whitelist middleware.

I was thinking about some type of regex that matches any string with /traefik inside of it, but I don't see any examples on the Traefik documentation.

https://doc.traefik.io/traefik/routing/routers/

Sincerely, -alexv305

I followed the documentation example: https://doc.traefik.io/traefik/routing/routers/

Upvotes: 0

Views: 1992

Answers (0)

Related Questions