manlio.perillo at gmail.com
Mon Mar 29 15:37:37 MSD 2010
-----BEGIN PGP SIGNED MESSAGE-----
When I wrote the WSGI module, 3 years ago, I decided to add support for
a "gateway" abstraction, implemented in a ngx_http_gateway.h and
ngx_http_gateway.c source files:
This "module" (it is not a real Nginx module, it only exposes some
functions) is a simple adaptation of the ngx_http_upstream module, for
applications embedded in Nginx, instead of external backend servers.
Right now its only purpose is to process HTTP response headers.
The gateway support is well suited for protocols like WSGI, since the
application has no direct access to the web server.
A WSGI application pass all the response headers to the server using the
The response body is returned by the application, as an iterable:
def application(environ, start_response):
start_response('200 OK', ['Content-Type', 'text/html'])
return ['Hello World']
Now I'm thinking to improve this "module", adding support for hiding
headers and, above all, caching.
I'm also thinking to move the code to a separate project.
Before doing so I would like to ask some advices:
1) If I release the code as a separate module, will it be used by some
It makes no much sense if it will only be used by my ngx_http_wsgi
I have read the code of other modules that allow embedding of
external applications, and they all offer direct access to Nginx HTTP
server; these applications can not take advantage of the gateway
2) Is it possible to add caching support for embedded applications
adapting existing code of the upstream module?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the nginx-devel