CORS error解决方法
2022-07-26 本文已影响0人
老街老街
server
{
listen 80;
server_name xxxxx.com;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/project/public;
# 允许跨域GET,POST,DELETE HTTP方法发起跨域请求
add_header 'Access-Control-Allow-Origin' *;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accep,Origin,User-Agent,DNT,Cache-Control,X-Mx-
ReqToken,X-Requested-With';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE';