美奇科技 发表于 2018-11-15 06:28:56

nginx 限制特殊目录下的php文件执行

  最近服务器被挂马,被***挂了小马(php文件)在image和images目录下面。在没有清楚***程序之前,先让nginx 在几个没有php文件的目录里面禁止解析php文件,配置如下
  php为fastcgi模式
  location ~ ^/(image|images)/.*\.(php|php5)$
  {
  deny all;
  }
  location ~ .*\.(php|php5)?$
  {
  fastcgi_pass127.0.0.1:9000;
  fastcgi_index index.php;
  include fcgi.conf;

页: [1]
查看完整版本: nginx 限制特殊目录下的php文件执行