404 page not found with docker and subdirectory

Hello

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


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 }})

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

Thanks For your help

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

Maybe try transmission6 :wink:

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

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:

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

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