Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重复设置 CORS headers(跨域头) #128

Closed
Dream4ever opened this issue Jan 12, 2021 · 0 comments
Closed

重复设置 CORS headers(跨域头) #128

Dream4ever opened this issue Jan 12, 2021 · 0 comments
Labels
Server The invisible hero

Comments

@Dream4ever
Copy link
Owner

解决过程

在测试后端 API 时,发现浏览器中报告 The 'Access-Control-Allow-Origin' header contains multiple values,上网搜了一下,原来是在不同的地方多次设置了 CORS headers 导致了这个错误。

看了一下后端程序和 Nginx 的配置,发现这两个地方都设置了 CORS,于是取消了 Nginx 中的设置,API 就可以正常访问了。

参考资料:

@Dream4ever Dream4ever added the Server The invisible hero label Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Server The invisible hero
Projects
None yet
Development

No branches or pull requests

1 participant