简体   繁体   中英

Traefik Reverse Proxy Ubooquity failure

I've been scratching my head over this one for a while now. Just exploring docker and web dev.

Setting up a local network only web domain. I want to be able to access all my services by name.home (plex.home, ebook.home, etc)

I've hit a wall with ubooquity. When I enter the url http://ebook.home:2203/ubooquity/admin everything is great, the page loads perfectly. When I enter ebook.home , it has trouble loading all the elements and looks like just the html is showing up.

This is my compose

version: '3'
services:
  ubooquity:
    image: ghcr.io/linuxserver/ubooquity
    networks:
      - traefik-public
      - ubooquity
    ports:
      - 2202:2202
      - 2203:2203
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
        #- "traefik.http.services.ubooquity.loadbalancer.server.port=888" # required by swarm but not used.        
        - "traefik.http.routers.ubooquity.entrypoints=web"
        - "traefik.http.routers.ubooquity.rule=Host(`ebook.home`)"
        #- "traefik.http.routers.ubooquity.rule=Host(`ebook.home`) && PathPrefix(`/admin`)"
        #- "traefik.port=2202"
        
        - "traefik.http.services.ubooquity.loadbalancer.server.port=2203"
        
        #redirect base URL to url/admin
        - "traefik.http.middlewares.ubooquity-addprefix.addprefix.prefix=/ubooquity/admin"
        #attach the middleware to the router
        - "traefik.http.routers.ubooquity.middlewares=ubooquity-addprefix@docker"        
networks:
  traefik-public:
    external: true
  ubooquity:
     external: true


What is happening here and how do i correct the issue? Thanks!

edit: Traefik config

version: '3'

services:
  reverse-proxy:
    image: traefik:v2.3.4
    command:
      - "--providers.docker.endpoint=unix:///var/run/docker.sock"
      - "--providers.docker.swarmMode=true"
      - "--providers.docker.exposedbydefault=false"
      - "--providers.docker.network=traefik-public"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.ubooquity-admin.address=:2203"
      - "--providers.docker"
      - "--api.insecure" # Don't do that in production
    ports:
      - 80:80
      - 443:443
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - traefik-public
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.http.services.traefik.loadbalancer.server.port=888" # required by swarm but not used.
        - "traefik.http.routers.traefik.rule=Host(`traefik.home`)"
        - "traefik.http.routers.traefik.entrypoints=web"
        #- "traefik.http.routers.traefik.tls.certresolver=letsencryptresolver"
        - "traefik.http.routers.traefik.service=api@internal"
        #- "traefik.http.routers.traefik.middlewares=traefik-auth"
        #- "traefik.http.middlewares.traefik-auth.basicauth.users=admin:$$apr1$$8EVjn/nj$$GiLUZqcbueTFeD23SuB6x0"
      placement:
        constraints:
          - node.role == manager

networks:
  traefik-public:
    external: true
    attachable: true

curl output

:~$ curl -v ebook.home
*   Trying 192.xxx.x.xx:80...
* TCP_NODELAY set
* Connected to ebook.home (192.xxx.x.xxx) port 80 (#0)
> GET / HTTP/1.1
> Host: ebook.home
> User-Agent: curl/7.68.0
> Accept: */*
>

Edit#2: Looks like my reverse proxy is working properly, this may be a Ubooquity issue. When opening the console on the failed page it see multiple errors relating to css files not loading.

The stylesheet http://ebook.home/ubooquity/admin-res/roboto.css was not loaded because its MIME type, “text/html”, is not “text/css”.

Still digging!

can you share your traefik config?

What is the config for web entrypoint? Have you specified 2203 port? According to treafik doc , it should looks like

## Static configuration
[entryPoints]
  [entryPoints.web]
    address = ":2203"

PI: You don't need to expose 2203 port in your docker file as your ubooquity container is in the same network as traefik

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM