Hi our friend
I create daphne.sock for websocket and gunicorn.sock for http
request and and in nginx.conf proxy_pass equals to unixes.
python manage.py runworker is ok without any Errors
but have this errors in nginx
1. failed: Error during WebSocket handshake: Unexpected response code: 404
2. failed: Error during WebSocket handshake: Unexpected response code: 500
according to this
this is nginx.config :
server{
listen 80;
server_name 185.252.11.11 domain.com;
location / {
proxy_set_header Host $http_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-Proto $scheme;
proxy_redirect off;
proxy_pass http://../gunicorn.sock;
}
location /static/ {
root /home/Farzand-user/Farazan_Parvari_Project/Farzand_Parvar/Farazan_Parvari_Project;
}
location /ws/ {
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_pass http://unix:/.../daphne.sock;
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-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
server is centos with directadmin , nginx 1.15