xsuid

写在开始之前

我想大家都“跨域”并不陌生

有时候根据业务需要是需要开启跨域

至于不晓得跨域是什么的,请度娘下,科普下


方式一

1、找到需要做跨域的域名对应的节点ip,登录ip的3311端口

2、在新窗口中找到左侧的回应控制->插入

3、如图

image

参数:

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

方式二

在区域设置下添加以下代码

<!--#start 200 -->
<config>
       <response action=\'allow\' >
               <table name=\'BEGIN\'>
                       <chain  action=\'continue\' >
                               <mark_add_header  or=\'1\'  attr=\'Access-Control-Allow-Origin\' val=\'*\'></mark_add_header>
                               <mark_add_header  or=\'1\'  attr=\'add_header Access-Control-Allow-Methods\' val=\'GET, POST, OPTIONS\'></mark_add_header>
                               <mark_add_header   attr=\'add_header Access-Control-Allow-Headers\' val=\'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization\'></mark_add_header>
                       </chain>
               </table>
       </response>
</config>


写在结尾之后

跨域设置就到这了

拜里个拜

分类:

技术点:

相关文章: