• 修改nginx配置来屏蔽svn目录

    日期:

    收到一封360网站安全检测的邮件 提示某个域名下的svn目录可以被直接访问,非常不安全 对小型网站,我习惯通过svn来部署代码,比sftp要方便很多 解决这个问题很容易,打开nginx配置文件,加入下面这段配置即可 location ~ ^(.*)\/\.svn\/ { deny all; } locati...

  • linux中 启动nginx是报错

    日期:

    Starting php_fpm PHP Warning: PHP Startup: Unable to load dynamic library /www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20060613/php_curl.dll - /www/wdlinux/php/lib/php/extensions/no-debug-non-zts-20060613/php_curl.dll: cannot open...

  • Linux下的nginx启动、重新启动

    日期:

    nginx的启动命令是: /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf -c制定配置文件的路径,不加-nginx会自动加载默认路径的配置文件。 以上是通用的启动命令 以下是转载的,对于有以下命令的nginx可以使用,没有以下命令的nginx,可以使...

  • nginx安装Modsecurity,实现waf功能

    日期:

    系统: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 扩展-ngx_http_google_filter_module

    日期:

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

  • nginx禁止直接以IP访问网站

    日期:

    经常出现这种情况,有哥们直接用IP访问公司网站,这样一看就不爽,所以通过nginx禁止直接以IP访问网站。 #在虚拟主机最前面加上如下即可,记住一定要作为第一个server(不然不生效)。如下,返回值404,可以改403等。 Nginx 0.8.20之前的版本如下: server { li...

  • 升级nginx

    日期:

    先查看下原来的编译参数 /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优化worker_processes(worker_cpu_affinity)

    日期:

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

  • nginx log记录请求的头信息

    日期:

    记录访问的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错误的终极解决方案

    日期:

    nginx+php-fpm出现502错误的终极解决方案 利用Nignx+php-fpm架构服务器的linux运维工程师们肯定都碰到过502 Bad Gateway错误的情况,出现502 Bad Gateway错误是由于php-fpm进程挂掉了,当然,当出现502 Bad Gateway错误的同时,我们也不得不说下504 timeout错...