# 全部代理
location / {
# 设置跨域
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers *;
# 代理到指定端口
proxy_pass http://xxx.xx.xx.xx:xxxx;
# options 快速返回 204
if ($request_method = 'OPTIONS') {
return 204;
}
}