nginx 设置允许跨越访问

nginx 设置允许跨越访问,在nginx 配置的server中添加下面内容

add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PATCH, DELETE, PUT, OPTIONS';
add_header 'Access-Control-Allow-Credentials' true;
add_header 'Access-Control-Allow-Headers' 'X-Requested-With,Content-Type';

【AD】美国洛杉矶CN2 VPS/香港CN2 VPS/日本CN2 VPS推荐,延迟低、稳定性高、免费备份_搬瓦工vps

【AD】#限时限量回归#搬瓦工:THE PLAN限量版套餐,2核/2GB/40GB SSD/1000GB/1Gbps,$27/季,$99/年,19机房可选,CN2 GIA/AS9929/日本/香港等