通过nginx控制ip端(在某个网段不给上传附件)才能上传附件

location /portal {

set $flag 0;

if ( $request_uri ~* "/portal/r/uf" ) {

 set $flag "${flag}1";

}

if ($http_x_forwarded_for !~ ^(192.168.3.100|123.123.123.123|222.222.222.222)) {

 set $flag "${flag}2";

}

if ( $flag = "012" ){

 return 403;

}

 

posted @ 2022-03-31 15:16  秃头的铲屎官  Views(59)  Comments(0Edit  收藏  举报