location ~ ^/(uploads|images)/.*\.(php|php5|jsp)$ {
deny all;
}
tips:在目录uploads、images目录下面的所有php、jsp都不能访问。location ~ ^/(uploads|images)/.*\.(php|php5|jsp)$ {
return 403;
}
这样也是一样的,如果配置了403页面,会跳转过去。error_page 403 http://www.webyang.net/public/404.html;
location ~.*\.sql {
deny all;
}
这样,任一目录的sql文件都不会被用户访问到了。
微信订阅号
已有1条评论