侧边栏壁纸
博主头像
WinJay博主等级

博观而约取 厚积而薄发

  • 累计撰写 307 篇文章
  • 累计创建 165 个标签
  • 累计收到 1 条评论
隐藏侧边栏

upstream sent too big header while reading response header from upstream

WinJay
2021-08-18 / 0 评论 / 0 点赞 / 70 阅读 / 3,102 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2021-12-16,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com

授权平台用户登录后报Nginx错误。
D3C7B87519AC401FA2AA0C29140A5083.jpeg

查看Nginx错误日志报错如下:

从上游读取响应头时上游发送的响应头过大

2021/08/18 09:27:10 [error] 6886#6886: *37668803 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"
2021/08/18 09:33:56 [error] 6886#6886: *37677775 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"
2021/08/18 09:34:03 [error] 6886#6886: *37677777 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"
2021/08/18 09:43:56 [error] 6886#6886: *37691299 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"
2021/08/18 09:44:31 [error] 6886#6886: *37691298 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"
2021/08/18 09:44:51 [error] 6886#6886: *37692076 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"
2021/08/18 09:45:19 [error] 6886#6886: *37692594 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"
2021/08/18 09:47:30 [error] 22378#22378: *37694856 upstream sent too big header while reading response header from upstream, client: 124.127.32.1, server: ra.nerc-edu.com, request: "POST /signin-oidc HTTP/1.1", upstream: "http://172.17.136.237:80/signin-oidc", host: "ra.nerc-edu.com"

image.png

查看Nginx配置文件信息如下:

server {
    listen 80;
    server_name ra.nerc-edu.com;

    location  / {
       proxy_pass http://172.17.136.237;
       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 Settings
       proxy_redirect     off;
       proxy_set_header   Connection       close;
       proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
       proxy_max_temp_file_size 0;
       proxy_connect_timeout      90;
       proxy_send_timeout         90;
       proxy_read_timeout         90;
       proxy_buffer_size          4k;
       proxy_buffers              4 32k;
       proxy_busy_buffers_size    64k;
      }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

将其中的proxy_buffer_size 4k;调整到8k proxy_buffer_size 8k; 后测试正常。

image.png

0

评论区