# 代理接口 location ^~ /api/ { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers Origin,X-Requested-Width,Content-Type,Accept; proxy_set_header referer "http://shanghaimon.aegis-info.com"; proxy_set_header host "shanghaimon.aegis-info.com"; proxy_pass http://shanghaimon.aegis-info.com/api/; } location ^~ /qyapi/ { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers Origin,X-Requested-Width,Content-Type,Accept; proxy_set_header referer "https://qyapi.weixin.qq.com"; proxy_set_header host "qyapi.weixin.qq.com"; proxy_pass https://qyapi.weixin.qq.com/; }
/usr/local/nginx/sbin/nginx -s reload
原文:https://www.cnblogs.com/dshvv/p/13729996.html