Nginx允许跨域设置
一、配置
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
add_header Access-Control-Allow-Headers X-Requested-With;
二、截图
三、生效
/usr/local/nginx/sbin/nginx -t
pkill -HUP nginx
一、配置
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
add_header Access-Control-Allow-Headers X-Requested-With;
二、截图
三、生效
/usr/local/nginx/sbin/nginx -t
pkill -HUP nginx
亲测有效,希望对大家有用.
1 COMMENT