今天开启了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. web前端面試題

    1.怎麼判斷一個一個變量的類型是string? typeof(obj)==="string" typeof obj==="string" obj.constru ...

  2. How to gitignore

    git rm -r --cached . git add . git commit -m "remove gitignore cache" git push

  3. Nintex History in Form Table

    一.设置参数 二.调用WebService 三.For Each 调用 四.拼写HTML Table 结果: 特别提示:过滤人只要根据人来循环即可

  4. codeforces472C

    Design Tutorial: Make It Nondeterministic CodeForces - 472C A way to make a new task is to make it n ...

  5. python基础数据类型--dict 字典

    字典 字典是python中唯一的映射类型,采用键值对(key-value)的形式存储数据.python对key进行哈希函数运算,根据计算的结果决定value的存储地址,所以字典是无序存储的,且key必 ...

  6. day5 range 用法示例

    函数语法 range(start, stop[, step]) 参数说明: start: 计数从 start 开始.默认是从 0 开始.例如range(5)等价于range(0, 5); stop: ...

  7. C/C++ 程序库

    C/C++ 程序库 // --------------------------------------------- 来几个不常见但是很变态的库吧: bundle: 把几乎所有常见的压缩库封装成了一个 ...

  8. ElasticSearch5.4.1 搜索引擎搭建文档

    安装配置JDK环境JDK安装(不能安装JRE)JDK下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-download ...

  9. css颜色表示法

    css颜色值主要有三种表示方法: 1.颜色名表示,比如:red 红色,gold 金色 2.rgb表示,比如:rgb(255,0,0)表示红色 3.16进制数值表示,比如:#ff0000 表示红色,这种 ...

  10. Apache rewrite地址重写

    Apache-rewrite+13个经典案例Apache 重写规则的常见应用(rewrite)一:目的 如何用Apache重写规则来解决一些常见的URL重写方法的问题,通过常见的 实例给用户一些使用重 ...