server{ server_name ; listen 80 default_server; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods 'GET,POST'; add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; access_log /var/log/nginx/uwsgi_xxx.log; location / { include uwsgi_params; uwsgi_pass unix:/myfiles/my_project/my_project/script/uwsgi.sock; } }
add_header 跨域配置