Nginx and uwsgi

Roberto De Ioris roberto at unbit.it
Mon Jun 11 13:48:17 UTC 2012


> Hi,
>
>
>
> We are building a Media Content Management and Delivery Platform based on
> Python (and python based web framework like Pylons/Pyramid). We are
> planning
> to use nginx as the web server.
>
>
>
> We are new to nginx (have prior experience with Apache) and have
> downloaded
> 1.2.1. The OS is CentOS.
>
>
>
> We are not sure how uwsgi works with nginx:
>
> 1.       Do we have to start uwsgi as a separate process?


Yes, but remember: uwsgi is a communication protocol (like http or
fastcgi), uWSGI is the application server.
You need to start uWSGI, and configure nginx to speak with it with the
protocol of choice (uwsgi, http or fastcgi)

>
> 2.       There is no option/directives for loading modules in nginx (as it
> is there in Apache).

nginx does not work in that way, but it should be not a problem for you as
upstream modules (http, fastcgi, scgi, uwsgi) are compiled in by default.


>
> 3.       I couldn't find a good documentation on the uwsgi based
> directives.
> The one in nginx wiki is confusing.

you need nothing particular:

include uwsgi_params;
uwsgi_pass <address>;

all the other options are for fine tuning.

I suggest you to start from here:

http://projects.unbit.it/uwsgi/wiki/Quickstart


>
> Since nginx I think works as a reverse proxy where it forwards HTTP
> requests
> to the uwsgi process, how about using something like Cherrypy or
> PasteHTTPserver? Would there be any difference?

you can proxy nginx to whatever you want/need if the backend speaks one of
the supported protocol (http, scgi, fastcgi, uwsgi)


-- 
Roberto De Ioris
http://unbit.it



More information about the nginx mailing list