Score:0

nginx upstream keep connection alive

lk flag

I'm trying to work out if it is possible to use nginx to work around the 230s idle timeout Azure App Services impose.

Our application currently has some long running http requests (and there is work to move to an async pattern, but looking for something in the meantime).

I've read that if you can pass some data over the connection then the request can run for longer than 230s - so bring in nginx!

I have this config based on what I can find in various docs and blogs, but when I trace the tcp packets I don't see it sending anything whilst the connection is waiting for a reply.

upstream longrunning.azurewebsites.net {
    server            longrunning.azurewebsites.net:80;
    keepalive_timeout 5m;
}

server {
        listen                        8080;
        listen                        [::]:8080;
        server_name                   longrunning.azurewebsites.net;

        access_log                    /var/log/nginx/reverse-access.log;
        error_log                     /var/log/nginx/reverse-error.log;

        keepalive_timeout             400s;

        location / {
          proxy_pass                  http://longrunning.azurewebsites.net;
          proxy_set_header Connection "";
          proxy_http_version          1.1;
          proxy_read_timeout          10m;
          proxy_socket_keepalive      on;
          proxy_connect_timeout       5m;
          proxy_send_timeout          5m;
          send_timeout                5m;
        }
}

Is what I'm trying even possible?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.