2 years ago

#53948

test-img

Husam Alhwadi

Websocket connection is failed [env: django channel, gunicorn, uvicorn, nginx, postgre and redis over https(wss)}

I have deployed my app on digitalOcean using this tutorial link ,https and all pages rendering properly and django working fine, The issue right now is websocket connection is failed, the error messages I got are from console web page says:

WebSocket connection to 'wss://mysitedomain/ws/chat/2_3/' failed:

Other error message from gunicorn server shows 404 not found page:

"GET /ws/chat/2_3/ HTTP/1.0" 404

Regardless what wss configuration I add it to nginx configuration file; connection is failed!!.. below is mysite configuration file under 'etc/nginx/sites_available' folder in linux for your reference ( I have removed all wss configuration blocks):

please note I already have installed uvicorn[standard] version but didn't help!!

 server {
    listen 80;
    server_name IP domain name;

  location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/user/DjangoProject;
   }
  location / {
    include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
    }
    
}

django

nginx

gunicorn

channel

uvicorn

0 Answers

Your Answer

Accepted video resources