vi /etc/nginx/nginx.confnginx
加入以下代碼rest
http {
###start####
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
###end ###
}it
:wq!保存service
service nginx restart 重啓nginx便可。vi