nginx 之 worker_connections 之错误 [wa
[warn]: 8192worker_connections are more than open file resource limit:1024这需要调整系统的文件描述符 nofileopen file resource limit是linux中process可以打开的文件句柄数量。增加这个数值需要调整两个配置:第一步, 修改系统最大允许的文件描述符查看当前的设置:$ cat /proc/sys/fs/file-max2390251或者 $ sysctl... « 阅读全文
几个Nginx子目录rewrite的例子
核心提示:一个Nginx新手常见的问题是拿到这些rewrite规则后不知道怎么改,比如Nginx下子目录的rewrite应该改成什么样子?/下是wordpress,/bbs下装个discuz,/是discuz,/blog下装个wordpress或者/下是wordpress,/blog下再装个word... « 阅读全文
FreeBSD 9.0中Php 5.3和Nginx 1的安装
shell>vi/etc/rc.d/rc.localshell>chmod555 /etc/rc.d/rc.localPhp1、准备编译环境:libxml2和libiconvshell>pkg_add-r libxml2a、libxml2shell>fetchftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gzshell>tarxvf libxml2-2.7.8.tar.gzshell>cdlibxml... « 阅读全文
nginx搭建支持flv mp4 seek 实现拖拽
wget http://sourceforge.net/projects/pcre/files/pcre/8.12/pcre-8.12.zip/downloadwget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gzwget http://nginx.org/download/nginx-1.0.0.tar.gzwget http://sourceforge.net/project... « 阅读全文
NGINX 502错误排查 Nginx 400错误
NGINX 502 BadGateway错误是FastCGI有问题,造成NGINX502错误的可能性比较多。我将502 Bad Gateway错误有关的问题和排查方法列一下,先从FastCGI配置入手:1.FastCGI进程是否已经启动2.FastCGI worker进程数是否不够运行 netstat -anpo | grep “php-cgi” | wc -l判断是否接近FastCGI进程,接近配置文件中设置的数值,表明worker进程数设置太少3.FastCGI执行时间过长f... « 阅读全文
nginx模块编译错误
gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o o... « 阅读全文
Nginx强制跳转https规则
在nginx服务器下http访问强制跳转为https过程中出现400BadRequest的解决方法,其中有提到做这个强制跳转来的目的是进行SSL数据加密,但并没有详细提到如何做,这里来说一说。在Apache的web服务器下,因为有.htaccess规则可以直接定义跳转伪静态,比如:编辑或上传需要设置... « 阅读全文
nginx 启动时提示 invalid event type "epo
nginx 启动时提示 invalid event type"epoll"内核是由redhat9 的 2.4.20升级到现在的 2.6.18nginx configure 的结果如下:# ./configure --user=www --group=www --prefix=/data/app/nginx--with-openssl=/usr/include --with-http_stub_status_modulechecking for OS+ Linux 2.6.18 i6... « 阅读全文
nginx配置文件解析之三
1. ngx_http_core_location(ngx_conf_t*cf,ngx_command_t *cmd, void *dummy)通过前面的分析,location部分的解析跟http和server是同样的道理。来看下面两句:clcf =ctx->loc_conf[ngx_http_core_module.ctx_index];clcf->loc_conf =ctx->loc_conf;ctx是在解析该location时生成的ngx_h... « 阅读全文
nginx的负载均衡
今天好不容易有点自己的时间,研究了下负载均衡,其实用nginx服务器很好实现的。我有三台服务器,IP分别是192.168.100, 192.168.101, 192.168.102,100这台做前端机,分配一个域名为www.test.com,然后100这台的ng配置文件如下:worker_processes 1;worker_rlimit_nofile 65535;events { useepoll; worker_connections 65535;}h... « 阅读全文

