https://www.jianshu.com/p/153615b79114

nginx静态资源跨域

    location ~* .*\.(gif|jpg|jpeg|png|bmp|swf|ppt|xls|xlsx)$ {
  	add_header Access-Control-Allow-Origin *;
  	add_header Access-Control-Allow-Headers X-Requested-With;
  	add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
 
    if ($request_method = 'OPTIONS') {
    	return 204;
    }
    	expires 30d;
    }

发表评论

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