nginx转发到uwsgi的配置

Posted on 2021-08-16 17:23  baskbug  阅读(264)  评论(0编辑  收藏  举报
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 跨域配置