我写了一个 setting(用户信息设置)页面,production 和 development 环境下,都没问题。但项目部署后,有时会出现 ,当然也有显示正常的时候。请指教。谢谢
upstream myapp{
server unix:/tmp/unicorn.hmp.sock;
#server unix:/tmp/unicorn.rhea.sock;
#server 192.168.1.7:9000;
}
server {
listen 80;
server_name hmp;
client_max_body_size 4G;
client_body_buffer_size 20M;
access_log /home/hmpuser/deploy/shared/log/access.log;
error_log /home/hmpuser/deploy/shared/log/error.log;
root /home/hmpuser/deploy/current;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby{
proxy_pass http://myapp;
}
}
2013/09/04 09:28:12 [error] 1121#0: *6454 upstream sent too big header while reading response header from upstream, client: 192.168.1.137, server: hmp, request: "GET /settings HTTP/1.1", upstream: "http://unix:/tmp/unicorn.hmp.sock:/settings", host: "192.168.1.7", referrer: "http://192.168.1.7/"
响应头的某一行过长,估计是 cookie。先在开发环境看看响应都发了哪些 cookie。 nginx 默认 header 支持的 header 长度有限,可以针对性的调整一下,但不建议调太高。
恩 正在尝试中。。有一个修改密码的验证码 是通过 session 保存的。。
def settings
session[:noisy_image] = NoisyImage.new(4) #生成一个有4字符的图片
session[:code] = session[:noisy_image].code
if current_user
@user=current_user
else
@user=User.find(params[:id])
end
end