NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream

后端 未结 11 1901
余生分开走
余生分开走 2020-11-28 19:47

I have Puma running as the upstream app server and Riak as my background db cluster. When I send a request that map-reduces a chunk of data for about 25K users and returns i

11条回答
  •  情歌与酒
    2020-11-28 20:19

    In your case it helps a little optimization in proxy, or you can use "# time out settings"

    location / 
    {        
    
      # time out settings
      proxy_connect_timeout 159s;
      proxy_send_timeout   600;
      proxy_read_timeout   600;
      proxy_buffer_size    64k;
      proxy_buffers     16 32k;
      proxy_busy_buffers_size 64k;
      proxy_temp_file_write_size 64k;
      proxy_pass_header Set-Cookie;
      proxy_redirect     off;
      proxy_hide_header  Vary;
      proxy_set_header   Accept-Encoding '';
      proxy_ignore_headers Cache-Control Expires;
      proxy_set_header   Referer $http_referer;
      proxy_set_header   Host   $host;
      proxy_set_header   Cookie $http_cookie;
      proxy_set_header   X-Real-IP  $remote_addr;
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Server $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    

提交回复
热议问题