cookies的值超出了範圍我是說php
看看了一下日誌html
sudo gedit /var/log/nginx/error.lognginx
查看錯誤日誌web
upstream sent too big header while reading response header from upstreamcookie
你去搜這個錯誤,網上的解釋都差很少,無外乎是cookie攜帶的header太多了,讓你設置:負載均衡
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;spa
逐步嘗試。其中fastcgi_buffers 8 128k 這句,fastcgi_buffers 32 32k 這樣更好,內存是整塊分配和釋放的,減小單位k數能儘量利用。日誌
另外,若是你用nginx作負載均衡的話,改了上述參數是沒用的,要在轉發的配置上,好比如下設置:htm
location @to_other {blog
proxy_buffer_size 128k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
add_header X-Static transfer;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend; #請求轉發
}
加粗的三行纔會起做用。
fastcgi_* 能夠理解成nginx接受client請求時的響應使用的。proxy是nginx做爲client轉發時使用的,若是header過大,超出了默認的1k,就會引起上述的upstream sent too big header。
能夠參考:
http://wiki.nginx.org/NginxHttpProxyModule
http://blog.sina.com.cn/s/blog_5dc960cd0100i4mt.html
其它搜索結果能夠無視,都是大同小異的。
location ~ \.php$ {
fastcgi_buffer_size 128k;
fastcgi_buffers 32 32k;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /host/web/$fastcgi_script_name;
}