nginx,apache屏蔽特定路径下的php,python解析
工作中碰到一些目录需要写入数据,为了安全起见需要屏蔽特定路径下的php,python解析。nginx相关配置:
location ~/(data|sites/upload)/.*\.(php|php5|py|pyc|sh)?$ {
deny all;
}
apache相关配置:
php_flag engine off
Order allow,deny
Deny from all
相关阅读:
http://stackoverflow.com/questions/1271899/disable-php-in-directory-including-all-sub-directories-with-htaccess
页:
[1]