异步gunicorn+;nginx+;Cors问题,但同步gunicorn+;nginx很好用

异步gunicorn+;nginx+;Cors问题,但同步gunicorn+;nginx很好用,nginx,asynchronous,gunicorn,gevent,eventlet,Nginx,Asynchronous,Gunicorn,Gevent,Eventlet,我在后端运行一个django应用程序,前面有gunicorn+nginx 在/etc/systemd/system/gunicorn.service中 [Service] User=user Group=www-data WorkingDirectory=/home/user/dev/backend/RecruitRest/recruit ExecStart=/home/user/miniconda3/envs/hire10x/bin/gunicorn --access-logfile /ho

我在后端运行一个django应用程序,前面有gunicorn+nginx

在/etc/systemd/system/gunicorn.service中

 [Service]
User=user
Group=www-data
WorkingDirectory=/home/user/dev/backend/RecruitRest/recruit
ExecStart=/home/user/miniconda3/envs/hire10x/bin/gunicorn --access-logfile /home/shivanand3939/dev/gunicorn.access.log --error-logfile /home/shivanand3939/dev/gunicorn.error.log  --timeout 1000 -k eventlet  --workers 1 --bind unix:/home/shivanand3939/dev/backend/RecruitRest/recruit/recruit.sock recruit.wsgi:application
这会抛出一个CORS错误,因为工人类是eventlet, 但如果删除该部分,即从上述代码中删除“-k eventlet”,则我的应用程序运行良好

我的nginx文件的位置部分如下所示:

location / {
      #include proxy_params;
     # proxy_pass http://unix:/home/shivanand3939/prod/RecruitRest/recruit/gunicorn.sock;
     # proxy_pass http://127.0.0.1:8000/;
      add_header Cache-Control private;
      add_header Cache-Control no-cache;
      add_header Cache-Control no-store;
      add_header Cache-Control must-revalidate;
      add_header Pragma no-cache;
      client_max_body_size 100M;
      proxy_buffering off;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
....<CORS SPECIFIC CODE> }
位置/{
#包括代理参数;
#代理通行证http://unix:/home/shivanand3939/prod/RecruitRest/recruit/gunicorn.sock;
#代理通行证http://127.0.0.1:8000/;
添加_头缓存控制私有;
添加_头缓存控制无缓存;
添加\u头缓存控制无存储;
添加头缓存控制必须重新验证;
添加标题Pragma no cache;
客户最大身体尺寸为100M;
代理缓冲关闭;
代理集头X-Forwarded-Proto$方案;
proxy\u set\u header X-Forwarded-For$proxy\u add\u X\u Forwarded\u For;
代理设置头主机$http\U主机;
代理集头X-Real-IP$remote\u addr;
.... }
我添加了一些规则,如文档中提到的关闭代理缓冲: 第35页

我需要在异步模式下运行gunicorn(因为我有一些阻塞请求),而不是在同步模式下运行。我需要做什么改变