Path under subdirectory returns 404

I'm having an issue with subdirectories. I've removed all middlewares to show the issue I'm having.

Note: Because I have removed the stripprefix I full expect for the service (backend) to respond with a 404 since it is listening for "/".


    image: phpmyadmin/phpmyadmin


      - sql

      - traefik_public

    restart: on-failure




      - "traefik.enable=true"

      - "traefik.http.routers.phpmyadmin.rule=Host(``) && Path(`/phpmyadmin`)"

      - "traefik.http.routers.phpmyadmin.entrypoints=websecure"

      - "traefik.http.routers.phpmyadmin.tls=true"

If I request a page that matches the router rule exactly things work as expected:

mtucker502@myserver:$ curl -k



<title>404 Not Found</title>


<h1>Not Found</h1>

<p>The requested URL was not found on this server.</p>


<address>Apache/2.4.38 (Debian) Server at Port 80</address>


I also see that my service is receiving and responding to this request:

mtucker502@myserver:$ docker logs mariadb_phpmyadmin_1 --since 1m - - [11/Feb/2020:14:57:52 +0000] "GET /phpmyadmin HTTP/1.1" 404 437 "-" "curl/7.58.0"

However if I request any page deeper in the router traefik sends a 404 and never forwards the request to my service:

mtucker502@myserver:$ curl -k

404 page not found

mtucker502@myserver:$ docker logs mariadb_phpmyadmin_1 --since 1m

Here are the relevant traefik logs: - - [11/Feb/2020:14:57:52 +0000] "GET /phpmyadmin HTTP/2.0" 404 276 "-" "-" 1056 "phpmyadmin@docker" "" 1ms

time="2020-02-11T14:58:06Z" level=debug msg="Serving default certificate for request: \"\"" - - [11/Feb/2020:14:58:06 +0000] "GET /phpmyadmin/test HTTP/2.0" 404 19 "-" "-" 1057 - - 0ms

Is this a misconfiguration on my end? How can I have the rule match phpmyadmin and all requests under phpmyadmin?

1 Like

I have now learned the difference between Path and PathPrefix :).

Hi @mtucker502,

Trying to get phpmyadmin on a subfolder path as well.
Would you be able to explain Path/PathPrefix difference and how you pulled it off?