Cannot reacreate Nginx proxy_pass behavior with Traefik

I'm trying to setup Traefik to replace my Nginx reverse proxy setup.
I have my domain setup like this:

I tried to recreate same setup with Traefik. First by using ReplacePathRegex and then StripPrefix. My api requests work fine, but when I try to use Portainer, requests made from web browser omit /portainer part which causes web ui to break.

For example:
I make request to
I get response and then consecutive requests should be made like this:
and instead it makes request like this:

Is there any way to setup Traefik behavior to exactly match Nginx proxy_pass?

EDIT: I noticed that I can access portainer if add add "/" to the end of request.

This is current setup. Is there any way to make it work no matter if I have "/" or not?

1 Like