一文看懂Nginx如何配置跨域,值得收藏
应用开发 2025-10-09 10:05:58
0

复制location / { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods GET,值得收藏 POST, OPTIONS; add_header Access-Control-Allow-Headers DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization; if ($request_method = OPTIONS) { return 204; } } 1.2.3.4.5.6.7.8.9.