您的位置:首页 > 理论基础 > 计算机网络

nginx apache lighttpd 禁止某些目录执行php

2014-10-10 09:38 696 查看
If your web server is apache ,you can add follow line:

<Directory /website/attachments>

php_flag engine off

</Directory>

We want disable upload directory php execute privileges on nginx,It’s so simple

location /upload/ {

location ~ .*\.(php)?$

{

deny all;

}

}

limit more directory

location ~* ^/(upload|images)/.*\.(php|php5)$

{

deny all;

}

If your web server is lighthttpd you can

$HTTP["url"] =~ “^/(forumdata|templates|customavatars?)/” {

fastcgi.server = ()

}

Apache:

<Location “/forumdata”>

php_admin_flag engine off

Options -ExecCGI

AddType text/plain .html .htm .shtml .php

</Location>

Hope it will help you.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: