本文介绍了从上游读取响应标头时,如何解决上游发送的标头太大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的日志中有此错误:

上游从上游读取响应标头时发送了太大的标头

upstream sent too big header while reading response header from upstream

我试图添加

proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;

到我的nginx.conf http块,但不起作用

to my nginx.conf http block but did not work

我也尝试添加

fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;

到我的conf文件,但找不到任何位置〜.php $ {

to my conf file but I could not locate any location ~ .php$ {

所以我想知道如何克服这个错误?添加

So I wonder how I can over come this error ?adding

fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;

到一个手工制作的php块给了我 nginx:/etc/nginx/nginx.conf:6中的[emerg]未知指令位置"

to a hand made php block gives me nginx: [emerg] unknown directive "location" in /etc/nginx/nginx.conf:6

推荐答案

通常,此参数解决上游发送的标题太大"的问题,并且您不需要它们的大值:)并将它们设置为http或服务器块,而不是位置.

Usually this parameters fix "upstream sent too big header" issue, and you dont need huge values for them :) And set them for http or server blocks, not location.

server {
...
    fastcgi_buffers  16 16k;
    fastcgi_buffer_size  32k;
}

有时,Firefox的FirePHP会创建较大的标头,请尝试暂时将其禁用.

Also sometimes FirePHP for Firefox creates large headers, try to disable it temporarily.

这篇关于从上游读取响应标头时,如何解决上游发送的标头太大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-22 23:20