人工智能

一文看懂Nginx如何配置跨域,值得收藏

时间:2010-12-5 17:23:32  作者:系统运维   来源:域名  查看:  评论:0
内容摘要:复制location/{ add_headerAccess-Control-Allow-Origin*; add_headerAccess-Control-

一文看懂Nginx如何配置跨域,值得收藏
复制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.
copyright © 2025 powered by 益强资讯全景  滇ICP备2023006006号-31sitemap