今天开启了nginx的error_log,发现了三个配置问题:

问题一:
2011/07/18 17:04:37 [warn] 2422#0: *171505004 an upstream response is buffered to a temporary file /opt/app/nginx/fastcgi_temp/9/80/0001539809 while reading upstream, client: 1.202.221.2, server: www.yongfu.com, request: "GET /recipe/all?cate=643&PHPSESSID=8c1135b85f1b5f90f55caab5ea7e1526 HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.yongfu.com"
问题分析:nginx的fastcgi设置的fastcgi_buffers太小,导致将缓存写入磁盘。
问题解决:修改nginx的配置,将fastcgi_buffers调大,参考了该文:http://www.ruby-forum.com/topic/140625
fastcgi_buffers 32 8k;
ok,问题解决,但又出现新的问题:
 
问题二:
2011/07/18 17:10:21 [warn] 2898#0: *171505297 a client request body is buffered to a temporary file /opt/app/nginx/client_body_temp/0001539931, client: 114.237.110.152, server: www.yongfu.com, request: "POST /recipe/create/58884?do=uploadstep HTTP/1.1", host: "www.yongfu.com", referrer: "http://www.yongfu.com/recipe/create/58884"
问题分析:还是缓存写入磁盘的问题。
问题解决:修改nginx.conf的client_max_body_size & client_body_buffer_size选项。参考了:http://nginx.org/pipermail/nginx/2009-July/013634.html
client_max_body_size 500m;
client_body_buffer_size 1024k;
 
问题三:
2011/07/18 16:43:39 [warn] 18326#0: *28601 using uninitialized "rule_1" variable, client: 192.168.1.6, server: yongfu.com, request: "GET /user/notice.php?callback=jsonp1310978365248&_=1310978696380 HTTP/1.1", host: "www.yongfu.com", referrer: "http://www.yongfu.com/act/cooking?m=creview"
问题分析:这个是因为我的rewrite规则里的变量rule_1的问题。
if (!-f $document_root$uri){
set $rule_1 "1"; 

if ($rule_1 = "1"){
rewrite ^/.*$ /rewrite.php last; 
}
说是没有定义rule_1,但我在那里定义了呀,没明白。但分析这两个判断,可以使用以下代码代替:
问题解决:
if (!-f $document_root$uri){ 
rewrite ^/.*$ /rewrite.php last; 
}

nginx buffered to a temporary 解决的更多相关文章

  1. Nginx an upstream response is buffered to a temporary file

    1.错误日志:warn:an upstream response is buffered to a temporary file 解决办法:增加fastcgi_buffers 8 4K;     fa ...

  2. nginx fastcgi_buffers to an upstream response is buffered to a temporary file

    fastcgi_buffers 16 16k; 指定本地需要用多少和多大的缓冲区来缓冲FastCGI的应答,如上所示,如果一个php脚本所产生的页面大小为256k,则会为其分配16个16k的缓冲区来缓 ...

  3. Nginx an upstream response is buffered to a temporary file,nginx502错误

    1.错误日志:warn:an upstream response is buffered to a temporary file 解决办法:增加fastcgi_buffers 8 4K;     fa ...

  4. Nginx warn:an upstream response is buffered to a temporary file

    我通过nginx下载文件,error.log中出现如下警告日志:warn:an upstream response is buffered to a temporary file  . 虽然网上各种例 ...

  5. nginx warn an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/ while reading upstream

    最近管理的nginx发现大量的error log,log内容如下: an upstream response is buffered to a temporary file /var/cache/ng ...

  6. nginx的buffered to a temporary警告

    nginx日志报a client request body is buffered to a temporary file 这个意思是客户全请求的文件超过了nginx的缓存区大小,nginx将内容写入 ...

  7. [转]权限问题导致Nginx 403 Forbidden错误的解决方法

    权限问题导致Nginx 403 Forbidden错误的解决方法 投稿:junjie 字体:[增加 减小] 类型:转载 时间:2014-08-22 这篇文章主要介绍了权限问题导致Nginx 403 F ...

  8. an upstream response is buffered to a temporary file

    an upstream response is buffered to a temporary file

  9. 用nginx的反向代理机制解决前端跨域问题在nginx上部署web静态页面

    用nginx的反向代理机制解决前端跨域问题在nginx上部署web静态页面 1.什么是跨域以及产生原因 跨域是指a页面想获取b页面资源,如果a.b页面的协议.域名.端口.子域名不同,或是a页面为ip地 ...

随机推荐

  1. css 優先級

    !impoetant:1000 行間樣式 id:100 類選擇器.屬性選擇器和偽類:10 元素及偽元素:1 通配選擇器:0 相同優先級的樣式,後來居上. 當超過256種的時候,瀏覽器會不遵守以上優先級 ...

  2. js模拟ctrl+c的问题

    1.这种方式只可以对显示的textbox和textarea使用,对于display:none和visibility hidden 以及其他标签无效 var message = document.get ...

  3. Supervisord管理进程实践

    今天凑空研究了下Supervisord,这是一款linux进程管理工具,使用python开发,主要用于在后台维护进程(类似master守护进程),可以实现监控进程的状态.自动重启进程等操作,便于一些服 ...

  4. codeforces467C

    George and Job CodeForces - 467C The new ITone 6 has been released recently and George got really ke ...

  5. kvm 一些web管理3方工具

    OpenNebula  Proxmox VE 

  6. linux不能上网问题

    第一种方法: 当linux不能上网,将网络配置成dhcp(注意:这里只能小写) onboot设置能yes 第二种方法: 第三种 window+r 快捷键 HKEY_LOCAL_MACHINE--> ...

  7. BZOJ2150部落战争——最小路径覆盖

    题目描述 lanzerb的部落在A国的上部,他们不满天寒地冻的环境,于是准备向A国的下部征战来获得更大的领土. A国是一 个M*N的矩阵,其中某些地方是城镇,某些地方是高山深涧无人居住.lanzerb ...

  8. POJ1442-查询第K大-Treap模板题

    模板题,以后要学splay,大概看一下treap就好了. #include <cstdio> #include <algorithm> #include <cstring ...

  9. 基准对象object中的基础类型----列表 (四)

    object有如下子类: CLASSES object basestring str unicode buffer bytearray classmethod complex dict enumera ...

  10. Codeforces734 E. Anton and Tree

    传送门:>Here< 题意:给出一颗树,节点不是黑色就是白色,每次可以将一个颜色相同的块变颜色,问最少变几次才能让其变为同色 解题思路: 我们考虑由于每一次都是把同样颜色的色块进行变色,因 ...