1. Caddy version (2.4.5
):
2. How I run Caddy:
docker-compose.yml
a. System environment:
Docker
b. Command:
systemd : docker-compose up
c. Service/unit/compose file:
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
{
email email@gmail.com
}
# REVERSE PROXY
# Values from config.env
# If this is localhost, use the port only.
# Only use PROXY_HOST if it is not localhost.
# No need to add PROXY_PORT if it is port 80.
{$PROXY_SERVER_NAME}, www.{$PROXY_SERVER_NAME} {
reverse_proxy {$INTERNAL_SERVER_NAME} {
header_up Host {$MAIN_UPSTREAM_HOST}
}
}
{$SOCK_PROXY_NAME}, www.{$SOCK_PROXY_NAME} {
reverse_proxy {$INTERNAL_SERVER_NAME} {
header_up Host {$SOCK_UPSTREAM_HOST}
}
}
#check for any docker image updates
http://wud.localhost {
reverse_proxy wud:3000
}
3. The problem I’m having:
I am using a docker-compose file to run my docker containers.
Everything ran great until I started getting timeouts on long-running tasks.
My tasks can take anywhere from 30 seconds to 3 hours, and it includes downloading files, processing them, then finally uploading them.
I am getting the following error a lot from my main server:
2021/10/30 06:15:28 write tcp 172.18.0.2:8000->172.18.0.4:47336: write: broken pipe
write tcp 172.18.0.2:8000->172.18.0.4:47336: write: broken pipe
write tcp 172.18.0.2:8000->172.18.0.4:47336: write: broken pipe
write tcp 172.18.0.2:8000->172.18.0.4:47336: write: broken pipe
172.18.0.4
is my Caddy reverse-proxy on the host network.
172.18.0.2
is my main server on a bridge network.
Is there anything I can do on the docker-compose file, docker settings, or Caddyfile to prevent this from happening?
I am at my wit’s end.
On further checking syslog
I can see the following:
Oct 30 06:15:26 vps-18000 docker-compose[964]: #033[36mcaddyserver |#033[0m {"level":"error","ts":1635596126.2547772,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"context canceled"}
4. Error messages and/or full log output:
Oct 30 06:15:26 vps-18000 docker-compose[964]: #033[36mcaddyserver |#033[0m {"level":"error","ts":1635596126.2547772,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"context canceled"}
5. What I already tried:
I have made sure that my actual server is not the cause. It is not outputting any programmatic errors apart from the above-mentioned.