首页 |  我的博客 |  查看该博主内容分类 | 

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
	}
	...
posted @ 2023-10-24 20:22  Z哎呀  阅读(60)  评论(0)    收藏  举报