Hi,

A proxy, in general terms, consists of a server socket and a http client,
> it's basic operation is to handle incoming requests to its server socket by
> issuing http requests to a backend using the http client. Keeping that in
> mind the keep-alive parameter applies to the http request that exists
> between a browser and the the proxy's server socket. The request to the
> backend in an entirely separate request and has its own parameters. It can
> even be, and habitually is, a different protocol (think ssl offloading or a
> fast cgi backend).
>

That's actually precisely what I am doing too.
I am using a rather standard NginX configuration for this:

server {
    listen 66.240.255.3:443 ssl http2;
    #server_name www.wonder-app.com ;
    server_name www.wonder-app.com;

    client_max_body_size 0;

    ssl_certificate /etc/nginx/ssl/www.xxxx.com.crt;
    ssl_dhparam /etc/nginx/ssl/dhparam.pem;
    ssl_certificate_key /etc/nginx/ssl/www.xxxx.com.key;

    location / {

      proxy_pass http://localhost:8080;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection 'upgrade';
      proxy_set_header Host $host;
      proxy_cache_bypass $http_upgrade;
    }
}


Thus, unless your proxy uses keep alive on the upstream request, you don't
> have to worry about that.
>

Yep -- and it doesn't.


> That's my case, the proxy we use is a custom built node http proxy based
> solution that does not use keep-alive on the backend requests.
>

That's interesting. How come you built your own?


> It's also the default for nginx (http://nginx.org/en/docs/
> http/ngx_http_upstream_module.html#keepalive)
>

Yep.
And since websockets is mainly for real-time messaging, and the client has
already been programmed so that if the connection drops it simply gets
re-established, it won't matter too much if the websockets get killed off
once the server is shut down...

I assumed that a keepalive connection from the client to the nginx server
would imply a keep-alive connection from nginx to the local node server
listening to an unprivileged port... but that's obviously not the case!
(Does that even matter? Would you ever want a keep-alive connection between
the proxy and the local node?)

Merc.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAOqUQ84BeQHr-F8J_nuDzCGME2%2BdfGZ7aV2sKA%3DHVU7TEW2n4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to