Create an additional router with rule=Host(…) && Path(`/`) and send a redirect to /guacamole. So the initial request to domain will automatically go to the required path.
You can’t simply add a prefix to every request, as the page will load dependencies like scripts and images, which will not work anymore.
By the way, this does not work, it will probably just overwrite the first router:
You can enter guacamole.example.com into your client/browser, Traefik will automatically redirect you to guacamole.example.com/guacamole, so you never have to type in the path.
So I have two routers: guacamole and guacamole-redir
I have add for each router:
- "traefik.http.routers.guacamole-redir.tls=true" or - "traefik.http.routers.guacamole.tls=true" and the resolver for each
I hope this is correct.
I do have a change concerning my pb. Now when typing https://guacamole.domain.ff it forward it to https://guacamole.domain.ff/guacamole (what I want) but I still have an error 404.
labels:
- "traefik.enable=true"
- "traefik.docker.network=mynet"
# regular guacamole router
- "traefik.http.routers.guacamole.entrypoints=https-external"
- "traefik.http.services.guacamole.loadbalancer.server.port=8080"
- "traefik.http.routers.guacamole.tls=true"
# redirect guacamole router for request without path, from / to /guacamole
- "traefik.http.routers.guacamole-redir.rule=Host(`guacamole.domain.org`) && Path(`/`)"
- "traefik.http.routers.guacamole-redir.tls=true"
- "traefik.http.routers.guacamole-redir.middlewares=guacamole-redir"
- "traefik.http.middlewares.guacamole-redir.redirectregex.regex=(.*)"
- "traefik.http.middlewares.guacamole-redir.redirectregex.replacement=$${1}guacamole"
2025-03-05T17:57:52+02:00 ERR Unable to obtain ACME certificate for domains error="unable to generate a certificate for the domains [guacamole-guacamole]: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rejectedIdentifier :: Invalid identifiers requested :: Cannot issue for \"guacamole-guacamole\": Domain name needs at least one dot" ACME CA=https://acme-v02.api.letsencrypt.org/directory acmeCA=https://acme-v02.api.letsencrypt.org/directory domains=["guacamole-guacamole"] providerName=dns-cloudflare.acme routerName=guacamole@docker rule=Host(`guacamole-guacamole`)
Is it the problem when not using staging for the ssl ? To many request ?
Cannot issue for \"guacamole-guacamole\": Domain name needs at least one dot
labels:
- "traefik.enable=true"
- "traefik.docker.network=mynet"
# regular guacamole router
- "traefik.http.routers.guacamole.entrypoints=https-external"
- "traefik.http.services.guacamole.loadbalancer.server.port=8080"
- "traefik.http.routers.guacamole.tls=true"
- "traefik.http.routers.guacamole.tls.certresolver=dns-cloudflare"
# redirect guacamole router for request without path, from / to /guacamole
- "traefik.http.routers.guacamole.rule=Host(`guacamole.domain.org`) && Path(`/`)"
- "traefik.http.routers.guacamole.middlewares=guacamole@docker"
- "traefik.http.middlewares.guacamole.redirectregex.regex=(.*)"
- "traefik.http.middlewares.guacamole.redirectregex.replacement=$${1}guacamole"
I have removed the second router (guacamole-redir) to make this config a bit less messy ...
I do not have anymore the SSL error 400 .... But still the 404.
Yes I do apologie, I haven't very well undertand the concept of a traefik router. I have add the 2 rules for each router, it is now working.
Thx a lot for your support.