Намерих проблема.
Моят [runserver] сокет (app.sock) трябва да бъде насочен под upstream django
и моят [wsserver] сокет (django.sock) трябва да бъде насочен под location /ws/
така:
upstream django {
server unix:/opt/django/app.sock;
}
server {
listen 80 default_server;
charset utf-8;
client_max_body_size 20M;
sendfile on;
keepalive_timeout 0;
large_client_header_buffers 8 32k;
location /media {
alias /opt/django/app/media/media;
}
location /static {
alias /opt/django/app/static;
}
location / {
include /opt/django/uwsgi_params;
}
location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://unix:/opt/django/django.sock;
proxy_buffers 8 32k;
proxy_buffer_size 64k;
}
}