Nginx
location /upload/ { location ~ .*.(php)?$ { deny all; } }
location ~* ^/(upload|images)/.*.(php|php5)$ { deny all; }
Apache
<Directory /webroot/attachments> php_flag engine off </Directory>
转载请注明:爱开源 » nginx apache 禁止指定目录 执行PHP文件
Nginx
location /upload/ { location ~ .*.(php)?$ { deny all; } }
location ~* ^/(upload|images)/.*.(php|php5)$ { deny all; }
Apache
<Directory /webroot/attachments> php_flag engine off </Directory>
转载请注明:爱开源 » nginx apache 禁止指定目录 执行PHP文件