代理后面的 Docker/Traefik

代理后面的 Docker/Traefik
  • 在我的 docker-compose 文件(在 Ubuntu 18.04 上)中我有以下配置;
  • Apache 部分
    • 项目基本网址被定义为drupal.docker.localhost_
    labels:
    - "traefik.http.routers.${PROJECT_NAME}_apache.rule=Host(`${PROJECT_BASE_URL}`)"
    - "traefik.http.services.${PROJECT_NAME}_apache.loadbalancer.server.port=80"

  • Traefik配置部分:
  traefik:
    image: traefik:v2.0
    container_name: "${PROJECT_NAME}_traefik"
    command: --api.insecure=true --providers.docker -log.level=DEBUG
    ports:
    - '8080:80'
#    - '8080:8080' # Dashboard
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

附加信息

  • Firefox 的答案:
État 503 Service Unavailable VersionHTTP/1.1 Transfert1,21 Ko (taille 885 o) Priorité de la requêteHighest Response Headers Content-Length 885 Content-Type text/html;charset=utf-8 Date Mon, 24 Jul 2023 11:12:06 GMT Mime-Version 1.0 Server squid/3.5.27 Via 1.1 prxpusx104 (squid/3.5.27), 1.1 prxpusx006 (squid/3.5.27) X-Cache MISS from prxpusx104 X-Cache MISS from prxpusx006 X-Squid-Error ERR_DNS_FAIL 0

Firefox 代理配置

jpmena@jpmena-ThinkCentre-M710t:/var/log/apache2$ tail -f access.log
127.0.0.1 - - [26/Jul/2023:14:31:44 +0200] "GET / HTTP/1.1" 200 3477 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
127.0.0.1 - - [26/Jul/2023:14:31:44 +0200] "GET /favicon.ico HTTP/1.1" 404 502 "http://drupal.docker.localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
127.0.0.1 - - [26/Jul/2023:14:31:44 +0200] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3624 "http://drupal.docker.localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"

相关内容