Problem with using Guacamole with Traefik reverse proxy

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with using Guacamole with Traefik reverse proxy

Minura Ratnasekara
I'm running a reverse proxy with all my apps in docker containers with subdirectories in the form of example.com/app, but I haven't been able to get this working with guacamole so far. Guacamole runs fine on the local network at 10.0.0.1:8082. I get a 404 error from apache tomcat when i try using the subdirectory address. I've included my docker script below.

  guacamole:

    image: "oznu/guacamole"

    container_name: "guacamole"

    volumes:

      - ${USERDIR}/docker/guacamole:/config

    ports:

        - "8082:8080"

    restart: always

    environment:

      - PUID=${PUID}

      - PGID=${PGID}

      - TZ=${TZ}

    networks:

      - traefik_proxy

    labels:

      - "traefik.enable=true"

      - "traefik.backend=guacamole"

      - "traefik.frontend.rule=Host:${DOMAINNAME}; PathPrefix: /guacamole"

#      - "traefik.frontend.rule=Host:guacamole.${DOMAINNAME}"

      - "traefik.port=8080"

      - "traefik.docker.network=traefik_proxy"


Thanks for any help in figuring this out!

Reply | Threaded
Open this post in threaded view
|

Re: Problem with using Guacamole with Traefik reverse proxy

vnick

On Sun, Jun 3, 2018 at 01:15 Minura Ratnasekara <[hidden email]> wrote:
I'm running a reverse proxy with all my apps in docker containers with subdirectories in the form of example.com/app, but I haven't been able to get this working with guacamole so far. Guacamole runs fine on the local network at 10.0.0.1:8082. I get a 404 error from apache tomcat when i try using the subdirectory address. I've included my docker script below.

  guacamole:

    image: "oznu/guacamole"

    container_name: "guacamole"

    volumes:

      - ${USERDIR}/docker/guacamole:/config

    ports:

        - "8082:8080"

    restart: always

    environment:

      - PUID=${PUID}

      - PGID=${PGID}

      - TZ=${TZ}

    networks:

      - traefik_proxy

    labels:

      - "traefik.enable=true"

      - "traefik.backend=guacamole"

      - "traefik.frontend.rule=Host:${DOMAINNAME}; PathPrefix: /guacamole"

#      - "traefik.frontend.rule=Host:guacamole.${DOMAINNAME}"

      - "traefik.port=8080"

      - "traefik.docker.network=traefik_proxy"


Thanks for any help in figuring this out!


I gather that you've built your own Docker image for Guacamole?  The first thing if try is to deploy three app in the Docker image such that it already had the party prefixed to it - so your local URL would be 10.0.0.1:8082/guacamole.  Unless your reverse proxy is set up specifically to intercept and rewrite all of the URLs that pass through, it's quite possible that out is trying to locate other resources at the root of that server rather than under the /guacamole path.

Also, make sure to have a look at the Guacamole manual section for proxying - it has several things that are important for making sure tunnels operate properly.

-Nick

Reply | Threaded
Open this post in threaded view
|

Re: Problem with using Guacamole with Traefik reverse proxy

Minura Ratnasekara
Thanks for your help Nick. I used the official images for docker and was finally able to get guacamole working with traefik. I'll leave my docker-compose file here in case anyone else has trouble. 

version: "3.3"

services:


 guacd:

    container_name: guacd_compose

    image: guacamole/guacd

    networks:

      - traefik_proxy

    restart: always

    volumes:

    - ${USERDIR}/docker/guacamole-docker-compose/drive:/drive:rw

    - ${USERDIR}/docker/guacamole-docker-compose/record:/record:rw

  

# postgres

  postgres:

    container_name: postgres_guacamole_compose

    environment:

      PGDATA: /var/lib/postgresql/data/guacamole

      POSTGRES_DB: guacamole_db

      POSTGRES_PASSWORD: password

      POSTGRES_USER: guacamole_user

    image: postgres

    networks:

      - traefik_proxy

    restart: always

    volumes:

    - ${USERDIR}/docker/guacamole-docker-compose/init:/docker-entrypoint-initdb.d:ro

    - ${USERDIR}/docker/guacamole-docker-compose/data:/var/lib/postgresql/data:rw



  # guacamole

  guacamole:

    container_name: guacamole_compose

    depends_on:

    - guacd

    - postgres

    environment:

      GUACD_HOSTNAME: guacd

      POSTGRES_DATABASE: guacamole_db

      POSTGRES_HOSTNAME: postgres

      POSTGRES_PASSWORD: password

      POSTGRES_USER: guacamole_user

    image: guacamole/guacamole

    links:

    - guacd

    networks:

      - traefik_proxy

    ports:

    - 8082:8080/tcp

    restart: always

    labels:

      - "traefik.enable=true"

      - "traefik.backend=guacamole"

      - "traefik.frontend.rule=Host:guac.${DOMAINNAME}; AddPrefix: /guacamole"

      - "traefik.port=8080"

      - "traefik.docker.network=traefik_proxy"



networks:

  traefik_proxy:

    external:

      name: traefik_proxy

  default:

    driver: bridge





On Sun, Jun 3, 2018 at 5:13 PM Nick Couchman <[hidden email]> wrote:
On Sun, Jun 3, 2018 at 01:15 Minura Ratnasekara <[hidden email]> wrote:
I'm running a reverse proxy with all my apps in docker containers with subdirectories in the form of example.com/app, but I haven't been able to get this working with guacamole so far. Guacamole runs fine on the local network at 10.0.0.1:8082. I get a 404 error from apache tomcat when i try using the subdirectory address. I've included my docker script below.

  guacamole:

    image: "oznu/guacamole"

    container_name: "guacamole"

    volumes:

      - ${USERDIR}/docker/guacamole:/config

    ports:

        - "8082:8080"

    restart: always

    environment:

      - PUID=${PUID}

      - PGID=${PGID}

      - TZ=${TZ}

    networks:

      - traefik_proxy

    labels:

      - "traefik.enable=true"

      - "traefik.backend=guacamole"

      - "traefik.frontend.rule=Host:${DOMAINNAME}; PathPrefix: /guacamole"

#      - "traefik.frontend.rule=Host:guacamole.${DOMAINNAME}"

      - "traefik.port=8080"

      - "traefik.docker.network=traefik_proxy"


Thanks for any help in figuring this out!


I gather that you've built your own Docker image for Guacamole?  The first thing if try is to deploy three app in the Docker image such that it already had the party prefixed to it - so your local URL would be 10.0.0.1:8082/guacamole.  Unless your reverse proxy is set up specifically to intercept and rewrite all of the URLs that pass through, it's quite possible that out is trying to locate other resources at the root of that server rather than under the /guacamole path.

Also, make sure to have a look at the Guacamole manual section for proxying - it has several things that are important for making sure tunnels operate properly.

-Nick