Monthly Archives: 七月 2013

nginx client_max_body_size 的问题

遇到上传文件问题 “413 Request Entity Too Large” 查到了 nginx client_max_body_size ,原来默认值只有 1m,太小了 增大他,在 location 中添加下面设置 client_max_body_size 6m; nginx reload, 不生效, 再试,把上面设置放 server 中,还不生效,继续放 http 中,这回生效了 这是什么问题,nginx 的文档上面明明写着 他可以放在 http server location 里面的 这是 nginx 的 bug,还是 nginx 的特性 如果是特性的话我想 http server … Continue reading

Posted in Linux | Tagged , | Leave a comment

ActionDispatch::RemoteIp::IpSpoofAttackError

使用 unicorn + nginx 运行 rails 有一段时间了,之前 nginx 这样配置 ip 地址 proxy_set_header X-Real-IP $remote_addr; 发现 rails 中获取到的 ip 是 127.0.0.1 , 然后又配置 CLIENT_IP proxy_set_header CLIENT_IP $remote_addr; 这样配置之后就发现了 rails 的错误 ActionDispatch::RemoteIp::IpSpoofAttackError 原来 rails 有 ip 防欺骗,再改 ningx 配置,加入 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; … Continue reading

Posted in ruby on rails | Tagged , , , | Leave a comment