Traefik与pgadmin4和PPrefix

时间:2018-06-04 14:33:12

标签: docker traefik

我试图让本地网络traefik设置使用路径并尝试公开pgadmin4。我有一个基本的traefik容器运行:80暴露,可以访问主机名/ whoami端点没有问题:

reverse-proxy:
    image: traefik # The official Traefik docker image
    command: --api --docker --logLevel="DEBUG" # Enables the web UI and tells Træfik to listen to docker
    ports:
      - "80:80"     # The HTTP port
      - "8080:8080" # The Web UI (enabled by --api)
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
    networks:
     - proxy
     - internal

  whoami:
    image: emilevauge/whoami # A container that exposes an API to show its IP address
    networks:
     - proxy
     - internal
    labels:
     - traefik.docker.network=internal
     - traefik.backend=whoami
     - "traefik.frontend.rule=Host:smalls;Path:/whoami/"

添加pgadmin4容器是有问题的

  admin:
      image: thajeztah/pgadmin4
      ports:
        - "8004:5050"
      networks:
        - internal
      labels:
        - "traefik.docker.network=internal"
        - "traefik.frontend.rule=Host:smalls;PathPrefixStrip:/pgadmin;AddPrefix:/browser"
        - "traefik.port=5050"

使用上面的前端规则我可以​​让pgadmin4页面开始加载,但是没有加载所有的静态(css,js等),因为浏览器无法解析URL。当通过转发端口访问pgadmin4时,我可以看到该烧瓶后端从'/'重定向到'/ browser',但我不确定如何在traefik中正确声明这条路径。

0 个答案:

没有答案