Hola guys,
I'm trying to add labels to my Apache Guacamole container. Currently, the container can be accessed and works perfectly at its address, but I would like users to be able to navigate straight to the subdomain rather than have to manually add /guacamole.
Subdomain:
foo.domain.com
To access the web ui, Guacamole requires you to visit:
foo.domain.com/guacamole
labels:
- traefik.enable=true
- traefik.http.routers.guacamole-all.entrypoints=https,http
- traefik.http.routers.guacamole-all.rule=Host(`sub.domain.com`)
- traefik.http.routers.guacamole-all.rule=Path(`/`)
- traefik.http.middlewares.guacamole-all.redirectregex.regex=.*
- traefik.http.middlewares.guacamole-all.redirectregex.replacement=/guacamole
- traefik.http.routers.guacamole-all.middlewares=guacamole-all@docker
- traefik.http.services.guacamole-all.loadbalancer.server.port=1234
This does indeed change the address to:
sub.domain.com/guacamole
But it still doesn't actually load anything? If I take the traefik redirect off again, then it works just fine...
I have also tried doing this via a file rule, and as an add prefix middlewares but couldn't get it to work. Any help greatly appreciated as I have exhausted everything I can think of/find in the docs.
cakiwi
March 17, 2021, 7:56pm
2
With your rule and match make your replacement $${0}guacamole
or you're chopping off the http(s)://sub.domain.com/
Thanks for your reply, to confirm:
- traefik.http.middlewares.guacamole-all.redirectregex.replacement=$${0}guacamole
I tried the above, but really weirdly, I'm getting another sub-domain redirecting to /guacamole?
cakiwi
March 17, 2021, 11:18pm
4
Your rule needs a logical &&, I missed it first time through.
- traefik.http.routers.guacamole-all.rule=Host(`sub.domain.com`) && Path(`/`)
Thank you, this works great and it does technically answer my question. For others benefit, these are the labels:
labels:
- traefik.enable=true
- traefik.http.routers.guacamole-all.entrypoints=https,http
- traefik.http.routers.guacamole-all.rule=Host(`sub.domain.com`) && Path(`/`)
- traefik.http.middlewares.guacamole-all.redirectregex.regex=.*
- traefik.http.middlewares.guacamole-all.redirectregex.replacement=$${0}guacamole/#/
- traefik.http.routers.guacamole-all.middlewares=guacamole-all@docker
- traefik.http.services.guacamole-all.loadbalancer.server.port=1234
Where $${0} translates to this part of the string:
https://sub.domain.com/
But I do still have a problem, because now the domain shows 100% correct domain in full:
https://sub.domain.com/guacamole/#/
But the Guacamole page does not load at all -- is this related to some kind of error with http headers maybe, or problem with websocket?
system
Closed
March 21, 2021, 12:08am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.