traefik v2 docker主机反向代理

时间:2019-12-25 15:02:58

标签: docker reverse-proxy traefik

我应该去https://example.com/mypath/actuator/health

我可以去https://example.com/mypath/-好吧

但是尝试https://example.com/mypath/actuator/health

时却找不到404错误

这是我的配置

version: "3.3"
services:
  traefik:
    image: "traefik:latest"
    command:
      - "--log.level=DEBUG"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web-secure.address=:443"
      - "--providers.docker=true"
      - "--providers.file.directory=/configuration/"
      - "--providers.file.watch=true"

    ports:
      - "80:80"
      - "443:443"
    networks:
      - web
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/some-folder/configuration/:/configuration/"
      - "/some-folder/ssl/:/certs/"

networks:
  web:
    driver: overlay
    attachable: true

我的标签文件

traefik.http.routers.some-service.rule=Host(`example.com`) && PathPrefix(`/some-service/`)
traefik.http.routers.some-service.tls=true
traefik.http.routers.some-service.entrypoints=web-secure
traefik.http.services.some-service.loadbalancer.server.port=8080
  

docker run --name some-service --net traefik_web -v   /some-path/some-service.properties:/opt/config.properties --label-file   ./labels -d some-repository / some-project / some-service:sometag

0 个答案:

没有答案