Your example documentation doesn’t include the X-Scheme header, which I think is pretty important when you are proxying to an HTTP backend but using HTTPS terminated at Traefik.
It wasn't needed in my testing. SCRIPT_NAME is the same thing, but passed to the environment of the container running pgAdmin. You do also need a label on the pgAdmin container though to tell Traefik to rewrite the URLs: traefik.frontend.rule=PathPrefix:/pgadmin4
FWIW, I wasn’t using a path but I was still unable to get it working correctly behind Traefik even with a SCRIPT_NAME=/
I didn't try using SCRIPT_NAME with the app mounted at the root of the vhost, so don't know if that works. The root is the default though, so you should be able to omit it.
I’ll take another look at it soon and see if I can get it working better with the newer container that has the servers.json change already included.
FWIW, I tested all the configs I documented using the pgAdmin 4.11 container and Traefik 1.7.12 running on the Docker host. I also tested some of the configs with the latest Traefik container, but I found I was getting the same behaviour with that as when running on the host so ended up finishing my work just using it on the host.