django+channels+gunicorn下的nginx配置参考
配置
需要配合一些包:pip install uvicorn[standard]
nginx.conf
...
location /ws { # websocket的路由最好以ws开头,区分,以及方便这里的配置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://0.0.0.0:8000
}
...

浙公网安备 33010602011771号