location ~* /application/(admin|index)/static/.*$ {
allow all;
}
location ~* /(applicaion|addos|coe|dta)/.*$ {
deny all; 禁止訪問
}
location ~* /(.git|.svn) {
deny all;
}
if ($http_cdn_src_ip ~ 'IP1|IP2|IP3' ) {
return 403;
}
#禁止訪問以下目錄的php
location ~* /(caches|include|statics|uploadfile)/.*\.(php|php5|php4)$ {
deny all;
}
location ~* /user/(caches|include|upfile|statics)/.*\.(php|php5|php4)$ {
deny all;
}
#禁止訪問以下目錄的html
location ~* /(caches|include|uploadfile)/.*\.(html|htm|phtml|phtm|txt)$ {
deny all;
}
location ~* /user/(caches|include|upfile|statics)/.*\.(html|htm|phtml|phtm|txt)$ {
deny all;
}
#不允許使用IP直接訪問 只能使用域名訪問網站
server{
listen 80 default_server;
server_name _;
return 403;
}