Docker traefik PathPrefix with StripPrefix Middleware always throws HTTP_502 Docker traefik PathPrefix with StripPrefix Middleware always throws HTTP_502 docker docker

Docker traefik PathPrefix with StripPrefix Middleware always throws HTTP_502


Not sure you must specify @docker, here a configuration that work with Traefik 2.2, and phpmyadmin as backend:

version: "2.4"services:  pma:    image: phpmyadmin/phpmyadmin:latest    labels:    - "traefik.http.routers.pma.rule=Host(`admin.${DOMAIN}`) && PathPrefix(`/phpmyadmin`)"    - "traefik.http.routers.pma.middlewares=pma-stripprefix"    - "traefik.http.middlewares.pma-stripprefix.stripprefix.prefixes=/phpmyadmin"    environment:    - PMA_ABSOLUTE_URI=https://admin.${DOMAIN}/phpmyadmin/


I am neither a Traefik nor a Docker expert. But I have been looking into similar things. I think, the problem is, that stripprefix will strip the whole path and not just the part that you give in your label. From the v2.0 Traefik documentation of stripprefix:

For instance, /products would match /products but also /products/shoes and /products/shirts.

Since the path is stripped prior to forwarding, your backend is expected to listen on /.

Therefore, I think your Traefik router is not forwarding tohttps://proxy.domain.com:5500/app. You could set your Treafik logging to DEBUG and then check with docker logs traefik (or whatever your Traefik container is called) where the router is actually forwarding the request to.