dj chat
1.0.0
项目地址参考:http://106.55.162.109:8888/ 账号:admin 密码:xhongc
python manage.py runserver 8088 or
daphne -b 127.0.0.1 -p 8088 dj_chat.asgi:applicationnginx + daphne + gunicorn + supervisor
tips: gunicorn 和 daphne 开不同的端口!
server {
listen 80;
server_name 106.55.162.109;
charset utf-8;
client_max_body_size 75M;
location /static {
alias /home/ubuntu/dj-chat/static;
}
access_log /home/ubuntu/chat_log/access.log;
error_log /home/ubuntu/chat_log/error.log;
location / {
proxy_pass http://127.0.0.1:8000;
include /etc/nginx/uwsgi_params;
}
location /ws {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
}
root /var/www/html;
index boot_chat.html;
}
docker-compose build
docker-compose up -d详细流程跳转到Docker部署应用 Django+daphne+Gunicorn+Nginx+Redis