> 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
>
>


native uWSGI sockets have websockets support by default http-websockets is
needed only if you are using the uWSGI http router.

change your emperor config to route only to uwsgi servers:

route = ^/ws uwsgi:/var/tmp/web.socket,0,0
route = ^/ uwsgi:/var/tmp/django.socket,0,0


and bind both vassals with socket =

A note:

add

offload-threads = 1

to the emperor to get automatic non-blocking concurrency

-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to