nginx 允许跨域配置
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';

nginx 代理配置
location /test/ 
proxy_pass http://127.0.0.1:8400/;
访问/test/ 或者/test  无效
访问/test/***   会代理到   /***

location /test
全部有效
代理路径为/test/***
最后修改:2024 年 06 月 21 日
如果觉得我的文章对你有用,请随意赞赏