Nginx Errors

upstream response cache error

*2470578 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/6/10/0000010106 while reading upstream

To fix


vim /etc/nginx/nginx.conf
# in http part of nginx.conf
proxy_buffer_size 512k;
proxy_buffers 8 512k;
proxy_busy_buffers_size 512k;
proxy_temp_file_write_size 512k;


client request body cache error

*2445185 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000010019

To fix


## in http part of nginx.conf
client_max_body_size 5M;
client_body_buffer_size 1M;


client send too large body size error (nginx 413)

*1245147 client intended to send too large body: 15152741 bytes

To fix


## in server location part
client_max_body_size 30M;


PHP fastcgi cache error

*2502029 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/3/11/0000010113 while reading upstream

To fix


fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;


PHP fastcgi path_info error

*1280448 using uninitialized "path_info" variable

To fix

## refer to https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/#

## fastcgi_param
## vim /etc/nginx/fastcgi_param
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name; fastcgi_param HTTPS $https; # PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200; ## vim /etc/nginx/conf.d/server1.conf
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
} fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}

[emerg] could not build the server_names_hash...

开始使用nginx只有一个虚拟主机,默认server_name 会使用 localhost, 今天配置nginx的server_name是一个正式存在的域名的时候,报错如下:

root@pts/0 $ nginx -t
nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /etc/nginx/nginx.conf test failed

How to fix

在nginx的配置文件nginx.conf的http段添加如下配置:

# vi /etc/nginx/nginx.conf
...
http {
...
server_names_hash_max_size 512;
server_names_hash_bucket_size 128;
...
}
... root@pts/0 $ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

nginx官方对server_name的说明请参考 链接

实例配置:

cat /etc/nginx/nginx.conf

client_max_body_size 100M;
client_body_buffer_size 128k;

proxy_buffers 8 512k;
proxy_buffer_size 512k;
proxy_busy_buffers_size 512k;
proxy_temp_file_write_size 512k;

Nginx Errors: upstream response cache error的更多相关文章

  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 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 ...

  3. 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 ...

  4. nginx之proxy、cache、upstream模块学习

    nginx之proxy反向代理模块: location ^~ /proxy_path/ { root "/www/html"; 这里没必要配置 index index.html; ...

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

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

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

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

  7. 7、nginx的upstream及fastcgi模块应用

    ngx_http_proxy_module, ngx_http_upstream_module   ngx_http_proxy_module:实现反向代理及缓存功能 proxy_pass http: ...

  8. nginx的upstream目前支持5种方式的分配

    Nginx   nginx的upstream目前支持5种方式的分配 FROM: 转载 1 轮询(默认) 每个请求按时间顺序逐一分配到不同的后端服务器, 如果后端服务器down掉, 能自动剔除. 2 w ...

  9. 记录一次nginx的upstream的配置信息

    nginx的upstream的配置信息 upstream qq.xiaoyu.cn { server 192.168.1.139:80 max_fails=3 fail_timeout=30s; se ...

随机推荐

  1. unity制作简单血条

    学习Unity已经10天了,也没发现有什么长进,真的急.昨天仿着官方Demo做了个射击游戏轮廓,其中需要给每个怪做一个血条. 搜了一些,挺复杂的,用NGUI或者UGUI,外加很长的代码...不过还是找 ...

  2. POJ 1988 Cube stacking【并查集高级应用+妙用deep数组】

    Description Farmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes ...

  3. 洛谷——P1589 泥泞路

    P1589 泥泞路 题目描述 暴雨过后,FJ的农场到镇上的公路上有一些泥泞路,他有若干块长度为L的木板可以铺在这些泥泞路上,问他至少需要多少块木板,才能把所有的泥泞路覆盖住. 输入输出格式 输入格式: ...

  4. priority_queue的运算符重载问题

    对于需要比较的函数或STL(最常见的为sort,priority_queue) 要对自创的结构进行运算符重载(sort可以写cmp,一样的效果) 1.只能对小于号重载 cmp函数与其起到相同的作用 2 ...

  5. 计算最大公约数 Exercise05_14

    import java.util.Scanner; /** * @author 冰樱梦 * 时间:2018年下半年 * 题目:计算最大公约数 * */ public class Exercise05_ ...

  6. Scala高手实战****第18课:Scala偏函数、异常、Lazy值编码实战及Spark源码鉴赏

    本篇文章主要讲述Scala函数式编程之偏函数,异常,及Lazy 第一部分:偏函数 偏函数:当函数有多个参数,而在使用该函数时不想提供所有参数(比如函数有3个参数),只提供0~2个参数,此时得到的函数便 ...

  7. iOS开发——使用Autolayout弹出键盘

    参考: http://segmentfault.com/q/1010000002420050 http://blog.csdn.net/qq448631961/article/details/4034 ...

  8. 使用FluentValidation来进行数据有效性验证

    之前我介绍过了使用系统自带的Data Annotations来进行数据有效性验证,今天在CodePlex上逛的时候,发现了一个非常简洁好用的库:FluentValidation 由于非常简洁,就直接拿 ...

  9. css3的cursor

    1.cursor属性参考表 还有zoom-in/zoom-out 还有grab/grabbing 2.css (1)前面的基本上就 .xx { cursor: pointer; } (2)后面两个有兼 ...

  10. 精通JavaScript攻击框架:AttackAPI

    多年来客户端安全一直未引起人们的足够重视,但是如今情况发生了急剧转变,客户端安全已经成为信息安全领域的焦点之一.Web恶意软件.AJAX蠕虫.浏览历史暴破.登录检测.傀儡控制技术网络端口扫描以及浏览器 ...