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 

   1.          
   https://avilpage.com/2018/05/deploying-scaling-django-channels.html
   2.          
   http://masnun.rocks/2016/11/02/deploying-django-channels-using-daphne/

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  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0effb95c-9a89-4f86-9790-f9709d349516%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to