# 404 page not found with docker and subdirectory

**URL:** <https://community.traefik.io/t/404-page-not-found-with-docker-and-subdirectory/17899>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [March 12, 2023, 10:39pm UTC](https://community.traefik.io/t/404-page-not-found-with-docker-and-subdirectory/17899 "2023-03-12T22:39:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eziminsk](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eziminsk](https://community.traefik.io/u/eziminsk)\
**Post date:** [March 12, 2023, 10:39pm UTC](https://community.traefik.io/t/404-page-not-found-with-docker-and-subdirectory/17899/1 "2023-03-12T22:39:26Z")

</div>

Hello

I follow some tuto to build my docker-compose.yml

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/2/26d2cc74149185f7f20a1f24f60f4747b2d75129.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/c/cc3b89d822cd50f604d85e9db6b2dac648ab7227.png)

I activate - --providers.docker.exposedbydefault=true  
I see my dockers and I defined a rule :

- --providers.docker.defaultRule=Host(`ns334560.ip-5-196-65.eu`) && Path(`/{{ trimPrefix `/` .Name }}`)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/a/ac381ebf99db5eb69bda70c081e2eb69c940bebe.png)

But When I try to go to https:\ns334560.ip-5-196-65.eu\trasmission6 For ex , I have 404 page not found

Also when I open treafik dashboard I have lots of logs

 ![image](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/4/4bc80f427a8f189180f3b7e0f51a06a0f696f546.png)

Thanks For your help

---

<div class="post-metadata">

**Author:** ![eziminsk](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eziminsk](https://community.traefik.io/u/eziminsk)\
**Post date:** [March 12, 2023, 10:47pm UTC](https://community.traefik.io/t/404-page-not-found-with-docker-and-subdirectory/17899/2 "2023-03-12T22:47:05Z")

</div>

In the accesslog I see the request

admin [12/Mar/2023:22:44:38 +0000] "GET /transmission6 HTTP/2.0" 404 19 "-" "-" 57 "thisproxytls@docker" "-" 0ms

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [March 13, 2023, 4:28pm UTC](https://community.traefik.io/t/404-page-not-found-with-docker-and-subdirectory/17899/3 "2023-03-13T16:28:45Z")

</div>

> [@eziminsk](#):
>
> trasmission6

Maybe try `transmission6` 😉

You are giving the transmission example, but are missing you transmission configuration.

Not sure what `trimPrefix` is supposed to do.

Note that `Path(`/path`)` will look for a fixed path, so `/path/a` will not work and the router will not match, use `PathPrefix()` instead if you want to use "deeper" paths, too.

Usually you would use a Docker network and attach all services to it. Make sure you use

```auto
networks
  proxy:
    name: proxy

```

to keep the network name consistent even when using multiple compose files. This makes it easier to use a fixed network name with `traefik.docker.network`.

Finally, make sure you have unique router names (like `mywhoami`) in labels when using multiple definitions:

```auto
labels:
  - traefik.enable=true
  - traefik.http.routers.mywhoami.rule=Host(`whoami.example.com`)
  - traefik.http.services.mywhoami.loadbalancer.server.port=80

```

---

<div class="post-metadata">

**Author:** ![eziminsk](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@eziminsk](https://community.traefik.io/u/eziminsk)\
**Post date:** [March 21, 2023, 1:46pm UTC](https://community.traefik.io/t/404-page-not-found-with-docker-and-subdirectory/17899/4 "2023-03-21T13:46:38Z")

</div>

> [@bluepuma77](#):
>
> `PathPrefix()`

I change the Path to `PathPrefix()`  
And I had to transmission the traefik configuration.  
I thought that it was automatic

|traefik.docker.network|traefik-public|  
|traefik.enable|true|  
|traefik.http.routers.transmission.entrypoints|websecure|  
|traefik.http.routers.transmission.rule|Host(`ns334560.ip-5-196-65.eu`) && (PathPrefix(`/transmission`))|  
|traefik.http.routers.transmission.service|transmission-svc|  
|traefik.http.routers.transmission.tls|true|  
|traefik.http.routers.transmission.tls.certresolver|letsencrypt|  
|traefik.http.services.transmission-svc.loadbalancer.server.port|9091|  
|traefik.http.services.transmission-svc.loadbalancer.server.scheme|http|  
|traefik.passHostHeader|true|

with this lines it works
