ngx_http_gateway_module

Manlio Perillo manlio.perillo at gmail.com
Mon Mar 29 15:37:37 MSD 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

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:
http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/src/ngx_http_gateway.h
http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/src/ngx_http_gateway.c

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
start_response callable.
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
   other modules?
   It makes no much sense if it will only be used by my ngx_http_wsgi
   module.

   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
   module

2) Is it possible to add caching support for embedded applications
   adapting existing code of the upstream module?



Thanks   Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuwkQEACgkQscQJ24LbaUT7YwCfZhc6JeSGhne32hSWM9H361l9
KjgAnR8Z0tPPf0sgLtO9a5piolB8PKdJ
=612L
-----END PGP SIGNATURE-----



More information about the nginx-devel mailing list