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

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.

上一篇:Hadoop常见错误2


下一篇:Flutter如何状态管理