我正在运行traefik以在docker容器内提供python django应用程序。该应用程序通过https或http正常运行。经过一段不确定的时间(不到一个小时)后,traefik日志显示“ 502 Bad Gateway ”,而我的nginx和uwsgi日志什么也没说。“ docker restart djangoapp”在短时间内解决了该问题。
互联网-> traefik-> nginx-> uwsgi-> djangoapp
debug = true
defaultEntryPoints = ["http", "https"]
# Access log
[traefikLog]
filePath = "/var/log/traefik/traefik.log"
format = "json"
[accessLog]
filePath = "/var/log/traefik/access.log"
format = "json"
[web]
address = ":8080"
[web.auth.basic]
users = ["admin:XXX/"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = "/etc/ssl/traefik/cert-register.stupa.pem"
keyFile = "/etc/ssl/traefik/key-register.stupa.key"
Run Code Online (Sandbox Code Playgroud)
version: '2'
services:
frontproxy:
image: traefik
container_name: frontproxy
command: --api --docker --docker.domain=docker.localhost …Run Code Online (Sandbox Code Playgroud)