So, I hit my head against the wall for most of 2 days, please help.
I am trying to establish a connection with Websocket using this django-websocket-redis . There are 2 instances of uwsgi startup, one for the website and one for sharing via web connection.
I used wirehark heavily to find out exactly what was going on, and apparently nginx eats the "Connection: Upgrade" and "Upgrade: websocket" headers.
here is the critical part of nginx configuration:
upstream websocket { server 127.0.0.1:9868; } location /ws/ { proxy_pass_request_headers on; access_log off; proxy_http_version 1.1; proxy_pass http://websocket; proxy_set_header Connection "Upgrade"; proxy_set_header Upgrade websocket; }
As you can see in these 2 screenshots , tcpdump internal communication shows that a handshake works great. but in my browser (second image) headers are missing.
Any ideas are welcome. I'm really stuck here :(
Versions:
nginx - 1.7.4 uwsgi - 2.0.7
pipette freezing: Django == 1.7 MySQL-python == 1.2.5 Django-Redis-sessions == 0.4.0 Django-WebSocket-Redis == 0.4.2 GEvent == 1.0.1 greenlet == 0.4.4 Redis == 2.10.3 six == 1.8.0 uWSGI == 2.0.7 wsgiref == 0.1.2
django nginx websocket uwsgi
DerShodan
source share