Jeg fandt problemet.
Min [runserver] socket (app.sock) skal peges under upstream django
og min [wsserver]-socket (django.sock) skal peges under location /ws/
sådan:
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;
}
}