docker - Traefik - 502 错误网关
问题描述
你好,
我正在尝试将Docker 容器连接到 Traefik。它不起作用。
我无法通过主机访问我的容器。
我尝试了几件事:检查端口,检查容器是否在同一个网络上,停止并重新启动网络,检查是否有错误等。无法看到它来自哪里。:(
我还有另外两个已经与 Traefik 一起使用的容器。但是这个容器不想...
我已经用头撞了两天了,现在我的额头上有一个角大小的肿块。
我的 traefik 码头工人日志:
msg="'502 Bad Gateway' caused by: dial tcp 172.23.0.6:5345: connect: connection refused"
我的 Docker 撰写文件:
services:
db:
image: mariadb:10.3
env_file:
- env/mysql.env
volumes:
- database_volume:/var/lib/mysql
#ports:
#- "127.0.0.1:3306:3306"
networks:
- traefik-public
passbolt:
image: passbolt/passbolt:latest-ce
#Alternatively you can use rootless:
#image: passbolt/passbolt:latest-ce-non-root
tty: true
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.vault-https.rule=Host(`vault.audiowizard.fr`)
- traefik.http.routers.vault-https.entrypoints=websecure
- traefik.http.routers.vault-https.tls=true
- traefik.http.routers.vault-https.tls.certresolver=lets-encrypt
- traefik.http.services.vault-https.loadbalancer.server.port=5345
depends_on:
- db
env_file:
- env/passbolt.env
volumes:
- gpg_volume:/etc/passbolt/gpg
- images_volume:/usr/share/php/passbolt/webroot/img/public
command: ["/usr/bin/wait-for.sh", "-t", "0", "db:3306", "--", "/docker-entrypoint.sh"]
networks:
- traefik-public
#ports:
#- 5080:80
#- 5443:443
#Alternatively for non-root images:
# - 80:8080
# - 443:4433
volumes:
database_volume:
gpg_volume:
images_volume:
networks:
traefik-public:
external: true
解决方案
我在注释代码中注意到您使用了以下端口。
#ports:
#- 5080:80
#- 5443:443
#Alternatively for non-root images:
# - 80:8080
# - 443:4433
但是你在标签中使用的端口是5343,
- traefik.http.services.vault-https.loadbalancer.server.port=5345
您能否再次检查这是否是正确的端口?
推荐阅读
- c - 如何在 C 中现有字节数组的末尾附加另一个 HEX 值
- nearprotocol - 托管和多重签名合约
- azure - 如何通过 ARM 创建应用洞察仪表板
- javascript - 执行没有响应的python函数 - Django
- python - 如何找到信号周期(自相关与快速傅立叶变换与功率谱密度)?
- c# - 您的目标项目“x”与您的迁移程序集“xx”不匹配。更改您的目标项目或更改您的迁移程序集
- rest - 几次 POST 请求后 GetResponseAsync 超时
- android - 单击时无法在 Android 应用程序中显示 pdf
- android - 如果 LiveData 没有属性支持,那么在 ViewModels 中使用 livedata-ktx 是否会导致内存泄漏?
- reactjs - 图片的平面列表未定义?