location /mars-api/ {
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
proxy_pass http://site/; //注意:这里一定要在后面加/,否则会报错404
}
upstream site{
server 172.16.xx.xx:7100;
server 172.16.yy.yy:7100;
}
网友评论