宝塔Nginx下禁网站某些特定目录下运行php
时间 :
2021-08-07
编辑 :admin
#下面禁止了CSS,JS,UPLOADS等五个目录运行php脚本文件的权限
location ~* ^/(css|js|uploads|fengshui|templets)/.*.(php)$ {
deny all;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 404 /404.html;