解决宝塔 Nginx 跨域问题Access-Control-Allow-Origin+预检请求opt...
```
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials 'true';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'x-csrf-token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
if ($request_method = 'OPTIONS') {
return 200;
}
```
明月浩空》原创,转载请保留文章出处。
本文链接:https://blog.myhkw.cn/post-162.html
版权声明:若无特殊注明,本文为《正文到此结束
22攻略