location /usercenter-service {
more_clear_headers "Access-Control-Allow-Origin";
more_clear_headers "Access-Control-Allow-Methods";
more_clear_headers "Access-Control-Allow-Headers";
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, PUT,DELETE';
add_header Access-Control-Allow-Headers 'Origin, X-Requested-With, Content-Type, Accept';
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass http://172.19.39.146:9055/usercenter-service;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 4;
proxy_send_timeout 1200;
proxy_read_timeout 1200;
}
相关文章
- 01-30前端跨域配置
- 01-30企业商家应该怎么做好抖音短视频运营帐号规划方案?品牌应该如何做孵化打造内容IP引流私域流量搭建社群电商体系?
- 01-30微服务解决跨域
- 01-30常用nginx rewrite重定向-跳转实例
- 01-30nginx负载均衡
- 01-30CVE-2020-1472 域内提权
- 01-30作用域
- 01-30类似nginx include 模式管理haproxy 配置文件
- 01-30nginx和haproxy的端口转发
- 01-30nginx-禁止ip访问或非法域名访问