- Traefik v2.2
I would like help to get on Traefik what I have on nginx.
Both Portainer and pgadmin4 work using path in the url.
On nginx.conf:
location /pgadmin4/ {
proxy_set_header X-Script-Name /pgadmin4;
proxy_set_header Host $host;
proxy_pass http://pgadmin4/;
proxy_redirect off;
}
location /portainer/ {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
proxy_pass_request_headers on;
proxy_pass http://portainer:9000/;
}
On docker-compose i try this:
(Pgadmin4)
labels:
- "traefik.enable=true"
- "traefik.http.routers.pgadmin4.rule=PathPrefix(`/pgadmin4`)"
- "traefik.http.routers.pgadmin4.middlewares=pgadmin4PStrip"
- "traefik.http.middlewares.pgadmin4PStrip.stripprefix.prefixes=/pgadmin4"
(Portainer)
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.rule=PathPrefix(`/portainer`)"
- "traefik.http.routers.portainer.middlewares=portainerPStrip"
- "traefik.http.middlewares.portainerPStrip.stripprefix.prefixes=/portainer"
Any help will be appreciated!