[ANN] mod_wsgi draft

Manlio Perillo manlio.perillo at gmail.com
Sat Sep 15 20:33:27 MSD 2007

Hi all.

I'm pleased to announce the availability of the first working draft of 
the wsgi module for nginx.

The code is available as a Mercurial repository:

It is possible to download a snapshot in gzip format:

There is still a lot of work to do and the current implementation has 
some limitations (some for design choices, others for keeping the 
implementation as simple as possible):

1) I have implemented the WSGI 2.0 draft
2) "app_iter" must produce only one item
3) Exceptions are not logged
4) Only one WSGI app can be executed, for a given nginx instance
5) SCRIPT_NAME e PATH_INFO environment variables are not supported
    (I have asked for help some messages ago)

IMPORTANT: Since the WSGI application is executed in the nginx process
            cycle, it can block the entire server.

The documentation is still missing, but you can use the documentation 
that came with Apache mod_wsgi:

nginx mod_wsgi additionally supports the directive "wsgi_param", similar 
to fastcgi_param: 

In conf/wsgi_params there are defined tha params required by WSGI.

In example/ there is a small example

To compile nginx, it suffice to do something like:
./configure --add-module=/home/manlio/projects/hg/nginx/mod_wsgi/ \
make install

from the main directory of the nginx sources (I'm using version 0.5.31).

By default nginx is installed in /usr/local/nginx, I suggest to choose 
as --prefix path a directory where you have write access as a limited 
user, so you can install and execute nginx withoud being root.

I would like to thank Igor Sysoev for having released nginx with an Open 
Source license, and for having written such a good code (although I 
would like to see more documentation :-)).

Many thanks to Evan Miller for his Guide To Nginx Module Development.

And many thanks to Graham Dumpleton (the author of the WSGI module 
implementation for Apache) since his module has been an invaluable 
resource for me.

Manlio Perillo

More information about the nginx mailing list