先看问题:
问题原文:
Access to XMLHttpRequest at ‘http://116.199.2.55:8004/follow_up/admin/v1/user-center/login’ from origin ‘http://127.0.0.1:8080’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘http://127.0.0.1:8080, *’, but only one is allowed
再看Nginx配置:
仔细对比错误信息, 问题就出在下面这句:
add_header 'Access-Control-Allow-Origin' '*';
注释掉该句
问题解决!