[uWSGI] Should use the uwsgi protocol or just http? (python and nginx)

Roberto De Ioris roberto at unbit.it
Tue Apr 21 17:06:50 CEST 2015

> 'Aloha Friends!
> I have a bunch of non-public RESTful webservices written in python. I run
> those with uwsgi in emperor mode. uwsgi that nginx is receiving requests
> on
> port 80. nginx use "location" rules and statements like "uwsgi_pass
> uwsgi://
> Before uwsgi and nginx I used tornado and had it listen directly on port
> 8080. I enjoyed to poke my services using curl.
> Q1: Does an uwsgi-curl tool exist? Is it at all possible?
> I could instead configure uwsgi to receive http requests and have nginx
> pass those directly. Would make my curl work again.

yes, just use --http-socket instead of --socket

> Q2: Any good reason why I should avoid running http between uwsgi and
> nginx?
> If I go that route, configure uwsgi receiving http requests, it leaves
> nginx with the plain dispatcher function, take a sub-location and pass it
> to a specific local port.
> Q3: is it possible to have uwsgi take care of this dispatching too,
> passing
> different sub-locations to different python applications?

uwsgi VS http is only relevant from a performance point of view (and to
accomplish some trick directly setting CGI vars from the webserver).

You can use the http router + subscription system to have dynamic routing
(without nginx or another webserver)

Roberto De Ioris

More information about the uWSGI mailing list