【发布时间】:2018-08-06 23:57:28
【问题描述】:
我有一个简单的 nginx 配置,但 CORS 有问题 这是我的 nginx 配置,它将 proxy_pass 请求传递给 api 应用程序。
location /myapp/result{
proxy_pass http://127.0.0.1:8084/myapp/result;
}
当我从邮递员那里发帖时,它工作正常,但在另一个网站上给出了一个 cors 错误,这是确切的消息:
无效的 CORS 请求
谢谢大家
【问题讨论】:
-
你是否在你的 nginx 配置中添加了任何头文件?
-
其实我已经添加了这样的 add_header 'Access-Control-Allow-Origin' '*' 但它是一样的
标签: nginx cors cross-domain proxypass