Error websocket 404

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Error websocket 404

Fatemeh Ahmadzadeh

Hi my  friends
I create daphne.sock for websocket and gunicorn.sock for http request , two ASGI and WSGI is activated 


python manage.py runworker is excellent and dont have any Errors



 nginx.conf proxy_pass equals to unixes. but have this errors according to this 

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;

          

          

 

        }


}


according to this page

  https://avilpage.com/2018/05/deploying-scaling-django-channels.html

http://masnun.rocks/2016/11/02/deploying-django-channels-using-daphne/
the HTTP request is wll but I have Errors in websocket  in console 
WebSocket connection to 'ws://domain/ws/' failed: Error during WebSocket handshake: Unexpected response code: 404 

server is centos with directadmin , nginx 1.15 



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/5e29f063-5760-49ce-916c-303a6eec7a0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error websocket 404

Aldian Fazrihady
Why there is http in this line:
proxy_pass http://unix:/.../daphne.sock;

Which one do you want to use,  http or unix socket?

On Thu, Jul 11, 2019 at 1:42 PM Fatemeh Ahmadzadeh <[hidden email]> wrote:

Hi my  friends
I create daphne.sock for websocket and gunicorn.sock for http request , two ASGI and WSGI is activated 


python manage.py runworker is excellent and dont have any Errors



 nginx.conf proxy_pass equals to unixes. but have this errors according to this 

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;

          

          

 

        }


}


according to this page

  https://avilpage.com/2018/05/deploying-scaling-django-channels.html

http://masnun.rocks/2016/11/02/deploying-django-channels-using-daphne/
the HTTP request is wll but I have Errors in websocket  in console 
WebSocket connection to 'ws://domain/ws/' failed: Error during WebSocket handshake: Unexpected response code: 404 

server is centos with directadmin , nginx 1.15 



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/5e29f063-5760-49ce-916c-303a6eec7a0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAN7EoAa9qdSc8wYV-wHCwLbqGFDfc2XoZLfsOtxOXys4HDgdWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error websocket 404

Adam Johnson-2
Hi!

I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer your support query with their limited time and energy. Read more on the mailing lists at https://www.djangoproject.com/community/

For support, please use the django-users mailing list, or IRC #django on Freenode, or a site like Stack Overflow. There are people out there willing to help on those channels, but they might not respond if you don't ask your question well. Stack Overflow's question guide can help you frame it well: https://stackoverflow.com/help/how-to-ask .

Also if you haven't read it, please take a look at Django's Code of Conduct: https://www.djangoproject.com/conduct/ . These are our "ground rules" for working well as a community, and will help you get the most out of Django and our fantastic community.

Thanks for your understanding,

Adam

On Thu, 11 Jul 2019 at 10:31, Aldian Fazrihady <[hidden email]> wrote:
Why there is http in this line:
proxy_pass http://unix:/.../daphne.sock;

Which one do you want to use,  http or unix socket?

On Thu, Jul 11, 2019 at 1:42 PM Fatemeh Ahmadzadeh <[hidden email]> wrote:

Hi my  friends
I create daphne.sock for websocket and gunicorn.sock for http request , two ASGI and WSGI is activated 


python manage.py runworker is excellent and dont have any Errors



 nginx.conf proxy_pass equals to unixes. but have this errors according to this 

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;

          

          

 

        }


}


according to this page

  https://avilpage.com/2018/05/deploying-scaling-django-channels.html

http://masnun.rocks/2016/11/02/deploying-django-channels-using-daphne/
the HTTP request is wll but I have Errors in websocket  in console 
WebSocket connection to 'ws://domain/ws/' failed: Error during WebSocket handshake: Unexpected response code: 404 

server is centos with directadmin , nginx 1.15 



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/5e29f063-5760-49ce-916c-303a6eec7a0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAN7EoAa9qdSc8wYV-wHCwLbqGFDfc2XoZLfsOtxOXys4HDgdWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM0XzCrO1zgw_1WP6ra%2BCHJn2CpMsrirDKZVKPw9L2EmAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Error websocket 404

Fatemeh Ahmadzadeh
In reply to this post by Aldian Fazrihady
both of them , http and socket.
daphne is for websocket
gunicorn is for http

On Thu, Jul 11, 2019 at 2:02 PM Aldian Fazrihady <[hidden email]> wrote:
Why there is http in this line:
proxy_pass http://unix:/.../daphne.sock;

Which one do you want to use,  http or unix socket?

On Thu, Jul 11, 2019 at 1:42 PM Fatemeh Ahmadzadeh <[hidden email]> wrote:

Hi my  friends
I create daphne.sock for websocket and gunicorn.sock for http request , two ASGI and WSGI is activated 


python manage.py runworker is excellent and dont have any Errors



 nginx.conf proxy_pass equals to unixes. but have this errors according to this 

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;

          

          

 

        }


}


according to this page

  https://avilpage.com/2018/05/deploying-scaling-django-channels.html

http://masnun.rocks/2016/11/02/deploying-django-channels-using-daphne/
the HTTP request is wll but I have Errors in websocket  in console 
WebSocket connection to 'ws://domain/ws/' failed: Error during WebSocket handshake: Unexpected response code: 404 

server is centos with directadmin , nginx 1.15 



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/5e29f063-5760-49ce-916c-303a6eec7a0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAN7EoAa9qdSc8wYV-wHCwLbqGFDfc2XoZLfsOtxOXys4HDgdWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMDsGPy4UxrNVUtNqAEco9YXFrts9vXWBQWvWuZGLYHHkKgCyA%40mail.gmail.com.