系统:centos 6.6 64位、 tengine 2.1.1, modsecurity 2.9.0 tengine : http://tengine.taobao.org/download/tengine-2.1.1.tar.gz modsecurity for Nginx: https://www.modsecurity.org/tarball/2.9.0/modsecurity-2.9.0.tar.gz OWASP规则集: https://gi...
下载Nginx Google扩展 1 git clone https://github.com/cuber/ngx_http_a href=https://www.olinux.org.cn/tag/google title=查看与 google 相关的文章target=_blankgoogle/a_filter_module 下载 substitutions扩展 1 git clone https://github.com/yaoweibin...
经常出现这种情况,有哥们直接用IP访问公司网站,这样一看就不爽,所以通过nginx禁止直接以IP访问网站。 #在虚拟主机最前面加上如下即可,记住一定要作为第一个server(不然不生效)。如下,返回值404,可以改403等。 Nginx 0.8.20之前的版本如下: server { li...
先查看下原来的编译参数 /usr/local/nginx/sbin/nginx -V configure arguments: --user=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --add-module=../ngx_cache_purge-1.0 --with-debug --with-http_sub_module sudo ./...
Nginx 优化:CPU(Core) + worker_processes(worker_cpu_affinity) 下面总结了,四线程、八线程、十六线程的CPU查看与Nginx进行配置内容: 配置1:4 CPU(4 Core) + 4 worker_processes(每个worker_processes 使用1个CPU) [it@it.net.cn ~]$ cat /proc/...
记录访问的log,为了在出现特殊情况时,方便检查出现问题的地方。 log_format accesslog $remote_addr - $remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for;access_log /var/log/nginx/ac...
nginx+php-fpm出现502错误的终极解决方案 利用Nignx+php-fpm架构服务器的linux运维工程师们肯定都碰到过502 Bad Gateway错误的情况,出现502 Bad Gateway错误是由于php-fpm进程挂掉了,当然,当出现502 Bad Gateway错误的同时,我们也不得不说下504 timeout错...
Nginx从0.7.48版本开始,支持了类似Squid的缓存功能。这个缓存是把URL及相关组合当作Key,用md5编码哈希后保存在硬盘上,所以它可以支持任意URL链接,同时也支持404/301/302这样的非200状态码。虽然目前官方的Nginx Web缓存服务只能为指定URL或状态码设置过期...
现在有这样一个需求,网站根目录下有静态文件,static目录下也有静态文件,static目录下的静态文件是程序批量生成的,我想让nginx在地址不变的前提下优先使用static目录里面的文件,如果不存在再使用根目录下的静态文件,比如访问首页http://example.com/ind...
nginx 会对uri中的字符进行解码然后传递给fastCGI,一般情况下也无妨,偏偏我的搜索词中含有反斜杠,编码后的地址 /search/Madmanfoo%2fLovesong/ nginx传递给php的地址就变成了,我用的PATHINFO所以无法得到正确的结果 /search/Madmanfoo/Lovesong/ 把nginx...