Communicating between nginx' modules

agentzh agentzh at gmail.com
Mon Dec 21 04:58:14 MSK 2009


On Sat, Dec 19, 2009 at 7:18 PM, agentzh <agentzh at gmail.com> wrote:
>
> Sure! And module A can also create module B's ctx for B to "fool" B ;)
> ngx_http_get_module_ctx just reads an item from the r->ctx array using
> the module index. No magic here :)
>

Actually, nginx variables can also be used for this purpose ;)
Especially in the subrequest context. A parent request passes
information to an nginx variable that a subrequest's handler can
recognize. This will work because according to the current
implementation of ngx_http_subrequest, the subrequest will inherit the
parent request's r->variables ;) Mudding with another module's context
might be a bad idea when that module is not yours :)

Cheers,
-agentzh



More information about the nginx-devel mailing list