小编use*_*537的帖子

NGINX:从上游读取响应头时,上游超时(110:连接超时)

我将Puma作为上游应用服务器运行,将Riak作为后台数据库集群运行.当我发送一个请求map - 减少大约25K用户的数据块并将其从Riak返回给应用程序时,我在Nginx日志中收到错误:

上游超时(110:连接超时),同时从上游读取响应头

如果我在没有nginx代理的情况下直接查询我的上游,使用相同的请求,我会得到所需的数据.

一旦放入代理,就会发生Nginx超时.

**nginx.conf**

http {
    keepalive_timeout 10m;
    proxy_connect_timeout  600s;
    proxy_send_timeout  600s;
    proxy_read_timeout  600s;
    fastcgi_send_timeout 600s;
    fastcgi_read_timeout 600s;
    include /etc/nginx/sites-enabled/*.conf;
}

**virtual host conf**

upstream ss_api {
  server 127.0.0.1:3000 max_fails=0  fail_timeout=600;
}

server {
  listen 81;
  server_name xxxxx.com; # change to match your URL

  location / {
    # match the name of upstream directive which is defined above
    proxy_pass http://ss_api; 
    proxy_set_header  Host $http_host;
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_cache cloud;
    proxy_cache_valid  200 302  60m;
    proxy_cache_valid  404 …
Run Code Online (Sandbox Code Playgroud)

timeout nginx puma

106
推荐指数
7
解决办法
27万
查看次数

标签 统计

nginx ×1

puma ×1

timeout ×1