spring boot 使用swagger nginx代理环境执行api测试跨域异常
springboot本地整合swagger后访问接口文档页面调用测试api接口响应正常,但部署到云服务器后通过nginx处理请求代理后端接口是报错。“TypeError :Failed to fetch”
需要在nginx配置中加入如下两项测试ok:
proxy_set_header Host $http_host;
proxy_redirect off;
springboot本地整合swagger后访问接口文档页面调用测试api接口响应正常,但部署到云服务器后通过nginx处理请求代理后端接口是报错。“TypeError :Failed to fetch”
需要在nginx配置中加入如下两项测试ok:
proxy_set_header Host $http_host;
proxy_redirect off;