(sorry, pressed send to early in my previous email)

Unfortunately I'am unable to get uWSGI's router, proxying my websocket
request to a uWSGI instance listening on a named unix socket.

In my configuration I have an emperor spawning two vassals. One vassal
serves normal Django requests, while the other vassal serves Websockets
requests. They both own a separate named Unix socket.

Currently nginx forwards requests to these two sockets and this works fine.
The nginx configuration inside a server section looks like this:

server {
    ....

    location / {
        include /opt/local/etc/nginx/uwsgi_params;
        uwsgi_pass unix:/var/tmp/django.socket;
    }

    location /ws/ {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://unix:/var/tmp/web.socket;
    }
}

Now I wanted to replace nginx by uWSGI itself and use its own routing
mechanism. For normal web requests this works fine and inside my
configuration I have

emperor.ini:

[uwsgi]
emperor = vassals
http-socket = :9090;  will be 80 in production
http-websockets = true
route = ^/ws http:/var/tmp/web.socket;   websocket requests don't work here
route = ^/ uwsgi:/var/tmp/django.socket,0,0;  normal requests work fine

vassals/websocket.ini:

[uwsgi]
master = true
no-orphans = true
threads = 1
processes = 1
die-on-term = true
memory-report = true
http-socket = /var/tmp/web.socket
module = wsgi_websocket:application
http-websockets = true
gevent = 1000
As said, this configuration works fine for connections originating from
nginx, but not for routed requests originating from uWSGI's internal router.
Is this because I use a named Unix socket?

Moreover, if I look at the nginx configuration some additional HTTP headers
are set. Where does uWSGI set these headers?
I used this configuration proposal from here:
http://uwsgi-docs.readthedocs.org/en/latest/WebSockets.html#routing
Version of uWSGI is 2.0.8


Thanks, jacob
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to