-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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?