Fix pgAdmin routing issues by updating environment variables and middleware headers

This commit is contained in:
Mohmmed Elfateh Sabry
2025-09-14 01:53:15 +03:00
parent 50cbe8d680
commit be689d1475

View File

@@ -219,6 +219,8 @@ services:
# Trust proxy headers
PGADMIN_CONFIG_PROXY_X_HOST_COUNT: '1'
PGADMIN_CONFIG_PROXY_X_PREFIX_COUNT: '1'
# Fix routing issues
SCRIPT_NAME: '/pgadmin4'
volumes:
- pgadmin_data:/var/lib/pgadmin
labels:
@@ -226,5 +228,8 @@ services:
- traefik.http.routers.pgadmin.rule=Host(`pgadmin.gate.${DOMAIN}`)
- traefik.http.routers.pgadmin.entrypoints=websecure
- traefik.http.routers.pgadmin.tls.certresolver=le
- traefik.http.routers.pgadmin.middlewares=security-headers
- traefik.http.services.pgadmin.loadbalancer.server.port=80
# Add headers for proper proxy handling
- traefik.http.middlewares.pgadmin-headers.headers.customRequestHeaders.X-Script-Name=/pgadmin4
- traefik.http.middlewares.pgadmin-headers.headers.customRequestHeaders.X-Scheme=https
- traefik.http.routers.pgadmin.middlewares=pgadmin-headers