作者:晴子suerw_980 | 来源:互联网 | 2014-06-17 10:53
apache nginx设置目录无执行权限的方法web服务有iis,apache,nginx,使用操作系统无非是windows or *nux
- location ~ ^/upload/.*.(php教程|php5)$
- {
- deny all;
- }
来看俩段通常对上传目录设置无权限的列子,配置如下:
- "/var/111cn.net/upload">
- ".php">
- order allow,deny
- deny from all
-
-
*nux就不同了,大家都是知道的*nux操作系统是区分大小写的
- "/var/www/upload">
- "(?i:.php)">
- order allow,deny
- deny from all
-
-
另外看一一nginx虚拟主机防webshell完美版 nginx.conf
- server
- {
- listen 80;
- server_name www.a.com;
- index index.html index.htm index.php;
- root /data/htdocs/www.a.com/;
- #limit_conn crawler 20;
- location ~ .*.(php|php5)?$
- {
- #fastcgi_pass unix:/tmp/php-cgi.sock;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include fcgi.conf;
- }
- }
- server
- {
- listen 80;
- server_name www.b.com;
- index index.html index.htm index.php;
- root /data/htdocs/www.phpfensi.com/;
- #limit_conn crawler 20;
- location ~ .*.(php|php5)?$
- {
- #fastcgi_pass unix:/tmp/php-cgi.sock;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include fcgi.conf;
- }
- }