我有一个正在处理API请求的应用。由于过程较长,因此应用程序响应所需的时间约为70秒,但是traefik会在10秒前返回502网关错误的响应。
version: '3.7'
services:
web_server:
image: traefik:v2.2
restart: always
ports:
- "80:80"
- "443:443"
- "8080:8080"
command:
- "--providers.docker=true"
- "--accesslog=true"
- "--api.insecure=true"
- "--log.level=DEBUG"
- "--api.dashboard=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.transport.respondingtimeouts.writetimeout=240"
- "--entrypoints.websecure.transport.respondingtimeouts.idletimeout=240"
- "--entrypoints.websecure.transport.respondingtimeouts.readtimeout=240"
- "--serverstransport.forwardingtimeouts.responseheadertimeout=240"
- "--serverstransport.forwardingtimeouts.idleconntimeout=240"
- "--serverstransport.forwardingtimeouts.dialtimeout=240"
- "--providers.docker.network=network_default"
# - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--certificatesresolvers.cosec.acme.httpchallenge=true"
- "--certificatesresolvers.cosec.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.cosec.acme.email=xxx@example.com"
- "--certificatesresolvers.cosec.acme.storage=/data/acme.json"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- traefik_data:/data
# - /dev/null:/traefik.toml
stop_grace_period: 120s
deploy:
update_config:
order: start-first
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m