Yes, Traefik will just proxy/forward the request.
But Portainer doesn’t know what to do with a request to path /portainer
. It expects an initial request to /
.
When you publish the port of Portainer directly to host and send the request to it, it will also respond with 404 for /portainer
, without Traefik.