部署nginx遇到的一些问题,有需要的朋友可以参考下。目前我们服务器部署方式是: client----->nginx----->apache+PHP 第一次使用nginx前端服务器和做反向代理,在一个星期监测遇到的问题和解决如下: 注:只是解决一些不爽的问题,对性能影响缺少评估,主要是缓存的一些设置 1. 错误日志:warn:an upstream response is buffered to a temporary file 因为我们下载文件比较多,默认会在nginx里缓存一下,所以关闭内容临时缓存: proxy_max_temp_file_size 0; 2. 错误日志:warn:upstream sent more data than specified in "Content-Length" header while reading upstream 关闭反向代理的内容缓冲: proxy_buffering off; 3. 连接超时:upstream timed out (110: Connection timed out) while reading response header from upstream 因为上传下载文件比较大,用时较长: nginx: proxy_connect_timeout 172800; php.ini: max_execution_time = 172800
max_input_time = 172800 4.错误日志:warn:a client request body is buffered to a temporary file
上传的内容比较大,缓存放不下,所以放到临时文件了。
但是我们是文件服务器,上传文件多,没有办法,不过对小文件还是缓存一下:
client_max_body_size 2050m;
client_body_buffer_size 1024k;
|
|