跨域问题总结

1.

 

 

nginx.conf

    location /xxxxxx-xxx/ {
      proxy_pass http://xxx.xx.xx.xxx:xxx;
      proxy_http_version 1.1;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_read_timeout 120s;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
    }

 

原因:使用了nginx代理后,提示这个报错,说明是没有使用到代理

解决方法:

 

 

 去掉你用的服务器地址,直接访问接口

 

 

 结果:

 

posted @ 2021-02-23 11:11  一路向北√  阅读(49)  评论(0编辑  收藏  举报

web应用开发&研究 -

业精于勤而荒于嬉。

工作,使我快乐。


Font Awesome | Respond.js | Bootstrap中文网