首页 > 解决方案 > NGINX:配置设置 120 秒超时,但在 60 秒后仍然报告(110:连接超时)

问题描述

proxy_read_timeout在位置配置中设置。

location / {
  proxy_connect_timeout 120s;
  proxy_send_timeout 120s;
  proxy_read_timeout 120s;
  include proxy_params;
  proxy_pass http://127.0.0.1:8081/;
}

proxy_params 是

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_set_header X-Forwarded-Proto $scheme;

Nginx conf中的http是

client_header_timeout 300;
client_body_timeout 300;
keepalive_timeout 300;

但是当我请求时,nginx在60s后报告超时。

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

我不明白哪个配置错误或丢失。我尝试阅读 nginx 文档,但找不到答案。

标签: nginx

解决方案


推荐阅读