Traefik v2 router Path rule not working

Try this simple test. Expose the portainer port 9000 with docker (to eliminate traefik form the equation) and go to http://your_host:9000/portainer. You will get 404. This is because portainer application does not serve anything at /portainer url. So naturally, you will get exactly the same result when using traefik.

I'm personally not a fan of hosting random apps behind url prefixes they do not expect, but with portainer I think a couple of people had success.

I though, recommend using a sub domain if you can at all, that's what I do.