ich777/docker-thunderbird

Cannot use addprefix when behind Traefik 2

Closed this issue · 2 comments

Created a compose snippet as part of a larger docker-compose. When starting with traefik labels only pointing to http://server:ip this works but starts in a dir where I have to click vnc.html and click connect in the no-vnc screen.

When using traefiks addprefix labels to connect to http://server:ip/vnc.html?autoconnect=true I am getting:

Error response

Error code: 404

Message: File not found.

Error code explanation: HTTPStatus.NOT_FOUND - Nothing matches the given URI.

This is the docker-compose snippet I am using:

#Thunderbird
  thunderbird:
    image: ich777/thunderbird
    container_name: thunderbird
    restart: unless-stopped
    networks:
      - t2_proxy
    security_opt:
      - no-new-privileges:true
    #port:
    #  - 8080:8080
    volumes:
      - $DOCKERDIR/appdata/thunderbird:/thunderbird
    environment:
      UID: $PUID
      GID: $PGID
      UMASK: 000
      DATA_PERM: 770
      CUSTOM_RES_W: 1536
      CUSTOM_RES_H: 864
      THUNDERBIRD_V: latest
      THUNDERBIRD_LANG: en-US
      TZ: $TZ
    labels:
      - "traefik.enable=true"
      #HTTP Routers
      - "traefik.http.routers.thunderbird-rtr.entrypoints=https"
      - "traefik.http.routers.thunderbird-rtr.rule=Host(`thunderbird.$DOMAINNAME0`)"
      #Middlewares
      #- "traefik.http.routers.thunderbird-rtr.middlewares=chain-authelia@file"
      - "traefik.http.routers.thunderbird-rtr.middlewares=chain-authelia@file,add-thunderbird"
      - "traefik.http.middlewares.add-thunderbird.addPrefix.prefix=/vnc.html?autoconnect=true"
      #HTTP Services
      - "traefik.http.routers.thunderbird-rtr.service=thunderbird-svc"
      - "traefik.http.services.thunderbird-svc.loadbalancer.server.port=8080"

Created a compose snippet as part of a larger docker-compose. When starting with traefik labels only pointing to http://server:ip this works but starts in a dir where I have to click vnc.html and click connect in the no-vnc screen.

Since I'm not really into Traefik nor Docker Compose I really can't help here but also remember that you have to forward the websocket.

Maybe this will help: Click
Also I don't know how Docker Compose and Traefic handles addprefix and why it causes this...

Here is my config that I use in nginx with Authelia:

server {
	listen 443 ssl;

	include /config/nginx/ssl.conf;
	include /config/nginx/error.conf;
	include /config/nginx/authelia-server.conf;

	server_name subdomain.example.org;

	location /websockify {
		include /config/nginx/authelia-location.conf;
		proxy_http_version 1.1;
		proxy_pass http://thunderbird:8080/;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";

		# VNC connection timeout
		proxy_read_timeout 61s;

		# Disable cache
		proxy_buffering off;
	}
		location / {
		rewrite ^/$ https://yoursubdomain.example.org/vnc.html?autoconnect=true redirect;
		include /config/nginx/authelia-location.conf;
		proxy_redirect     off;
		proxy_set_header Range $http_range;
		proxy_set_header If-Range $http_if_range;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
		proxy_pass http://thunderbird:8080/;
	}
}

Thanks, tried it with websocket settings but couldn't get it to work the right way. For the time being I'll click the links and see if I can find another solution.