可以通过修改nginx.conf配置文件实现。
方法如下:
禁止单目录:
location ~* ^/attachments/.*.(php|php5)$ {deny all;}
禁止多目录:
location ~* ^/(attachments|upload)/.*.(php|php5)$ {deny all;}
注意:
1、以上的配置文件代码需要放到 location ~ .php{…}上面,如果放到下面是无效的。
3、不要忘记重启nginx
service nginx restart
可以通过修改nginx.conf配置文件实现。
方法如下:
禁止单目录:
location ~* ^/attachments/.*.(php|php5)$ {deny all;}
禁止多目录:
location ~* ^/(attachments|upload)/.*.(php|php5)$ {deny all;}
注意:
1、以上的配置文件代码需要放到 location ~ .php{…}上面,如果放到下面是无效的。
3、不要忘记重启nginx
service nginx restart
联系邮箱:admin#wlmqw.com
工作时间:周一至周五,10:30-18:30,节假日休息