Prefix / sub folder addition works, but page still doesn't load, works without adding prefix

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.

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?

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?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.