今天开启了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. word2vec训练&IC分词(待)

    参考http://www.52nlp.cn/%E4%B8%AD%E8%8B%B1%E6%96%87%E7%BB%B4%E5%9F%BA%E7%99%BE%E7%A7%91%E8%AF%AD%E6%96 ...

  2. xml模块 增删改查

    import xml.etree.ElementTree as ET tree = ET.parse("xml test") #open root = tree.getroot() ...

  3. Nginx 完整安装篇

    第一步安装各种编译库如c++编译库等 yum install -y gcc //安装GCC ...安装过程省略 yum install -y gcc-c++ //安装C++库用来编译c++ ...安装 ...

  4. Nginx 反向代理接收用户包体方式

    陶辉91课 如果proxy_request_buffering 设置为on的时候是等待nginx读取完包体后再发送上游服务器 一般依赖于nginx处理能力  client_body_in_file_o ...

  5. 5G到来,数据中心如何变革?

    导读 5G将要到来,除改变人们的工作生活外,其带宽.延时.连接特性也逼迫着数据中心变革,以满足5G时代需求.具体而言,5G将从形状规模.硬件组成及软件规模三面变革数据中心. 5G带来什么 高带宽.低延 ...

  6. 使用Java泛型返回动态类型

    返回一个指定类型的集合,并且clazz必须继承IGeoLog对象或者是其本身 <T extends IGeoLog> List<T> getLogListSql(Class&l ...

  7. BZOJ1444[Jsoi2009]有趣的游戏——AC自动机+概率DP+矩阵乘法

    题目描述 输入 注意 是0<=P, n , l, m≤ 10. 输出 样例输入 input 1 3 2 2 1 2 1 2 AB BA AA input 2 3 4 2 1 2 1 2 AABA ...

  8. BZOJ3724PA2014Final Krolestwo——欧拉回路+构造

    题目描述 你有一个无向连通图,边的总数为偶数.设图中有k个奇点(度数为奇数的点),你需要把它们配成k/2个点对(显然k被2整除).对于每个点对(u,v),你需要用一条长度为偶数(假设每条边长度为1)的 ...

  9. Shell 流程控制-if 语句

    单分支if条件语句 if [ 条件判断式 ] ; then程序fi 例子:判断分区使用率 #!/bin/bash # Author: huangrui (Email:mycheryhr@gmail.c ...

  10. SDOI2017 Round1 简要题解

    我们 TM 怎么又要上文化课..我 哔哔哔哔哔哔 「SDOI2017」数字表格 题意 有 \(T\) 组数据,求 \[ \prod_{i = 1}^{n} \prod_{j = 1}^{m} fib[ ...