nginx禁止跨域访问
set $flag "0";
if ($http_origin !~* "^https://xy.ctmmedia.com.cn") {
set $flag "1";
}
if ($request_method = "POST") {
set $flag "${flag}2";
}
if ($request_uri ~* "school/sysDict/redisRefresh") {
set $flag "1";
}
if ($flag = "12") {
return 404;
}
add_header Access-Control-Allow-Origin 'https://xy.ctmmedia.com.cn';
location /school/ {
set $flag "0";
if ($http_origin !~* "^https://xy.ctmmedia.com.cn") {
set $flag "1";
}
if ($request_method = "POST") {
set $flag "${flag}2";
}
if ($request_uri ~* "school/sysD