3
votes

My goal is to have my static files served by nginx and my dynamic pages by nodejs. It worked perfectly fine for now. But i'm currently adding a functionality using websocket, nginx doesn't support websocket for the moment so i thought to use varnish in front to route directly websocket connections to my node app.

I set the conf as told on varnish doc but it doesn't work as expected. My websocket is in pending state which its normal behaviour and while it's in pending state, varnish refuses any other connection, even 2 minutes after it's closed...

1
The default recommended varnish configuration supports thousands of concurrent client connections. If you think one connection is preventing other connections from occurring, I'd guess your problem lies elsewhere. Did you ever figure this out? - Johnny C

1 Answers

1
votes

I'm not sure if this is the solution but I think you should add connection: close in your pipe sub:

sub vcl_pipe {
    set bereq.http.connection = "close";
    return (pipe);
}