解决Nginx跨域问题

/ 0评 / 2

以下代码放入伪静态

location / {
if ( $request_method = ‘OPTIONS’ ) {
add_header access-control-allow-headers range;
add_header access-control-allow-methods GET,POST,HEAD,OPTIONS;
add_header access-control-allow-origin *;
return 200;
}
add_header access-control-allow-origin *;
}

发表评论

邮箱地址不会被公开。 必填项已用*标注