I have a website running behind a Varnish proxy. Any connection open for server-sent events never gets any content and never closes. Varnish seems to wait for the content stream to end before forwarding that content to the browser. And it keeps the connection open to the server until the content ends. Both of those issues are incompatible with server-sent events.
How can I configure Varnish to flush content immediately to the browser and close its connection to the server when the browser closes its connection?
Or can I dynamically instruct Varnish to act entirely as a pass-through for connections as if it weren’t even there? I can run the exact same web application on non-proxied systems with no problems. And I can’t completely bypass Varnish in this setup (e.g. different port).
Have you tried to return pipe in vcl_recv ?
From the documentation :
Don’t miss that you have to return pipe only for SSE incoming requests.