在Nginx上连接套接字时出现错误

时间:2018-09-05 08:13:52

标签: nginx

“ Access-Control-Allow-Origin”标头包含多个值“ http://localhost:4200,“ AWS上我的服务器的IP”,但只允许一个。因此,不允许访问来源“ http://localhost:4200”。

我的nginx文件如下:

 add_header 'Access-Control-Allow-Origin' '*';
 add_header 'Access-Control-Allow-Credentials' 'true';
 add_header 'Access-Control-Allow-Methods' 'GET, POST,PUT,OPTIONS';
 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

0 个答案:

没有答案
相关问题