1. Caddy version (caddy version
):
2.3.0-alpine
2. How I run Caddy:
as a docker container, to reverse proxy to a golang app running in another container in the same network.
a. System environment:
Docker For Desktop on Windows 10 (WSL2)
b. Command:
c. Service/unit/compose file:
caddy:
image: caddy:2.3.0-alpine
volumes:
- ./scripts/Caddyfile:/etc/caddy/Caddyfile
ports:
- 8787:80
d. My complete Caddyfile or JSON config:
route /api/* {
reverse_proxy server:8000
}
route /* {
root * /srv
try_files {path} /index.html
file_server
}
}
3. The problem I’m having:
As mentioned in the streaming section, reverse_proxy (Caddyfile directive) — Caddy Documentation, caddy checks the mime type to be text/event-stream
and instantly flushes the response. I confirmed this in the reverse proxy code too, however its not doing so for my application for some reason
In the apps frontend I can see the events coming all at once and after the server closes the stream i.e caddy is buffering it.
4. Error messages and/or full log output:
5. What I already tried:
explicitly setting flush_interval -1
in the Caddyfile