location / {
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Credentials true;
add_header Access-Contol-Allow-Methods "POST,GET";
proxy_pass http://127.0.0.1:8080;
location / {
if ($http_origin ~* "^https?:\/\/.*\.xxx\.com($|\/)"){
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Credentials true;
add_header Access-Contol-Allow-Methods "POST,GET";
}
proxy_pass http://127.0.0.1:8080;
}