Pointers on writing an Nginx module/application which needs to talk to multiple backends (sometimes sequentially, sometimes parallel) to serve a single request

Piotr Sikora piotr.sikora at frickle.com
Thu Mar 8 13:30:42 UTC 2012


Hi,

> but figured that eval does
> an in-memory subrequest, while Piotr's postgres module above doesn't
> support in-memory subrequest.  Has anyone modified postgres module
> code to work with in-memory sub-requests?

agentzh forked eval module and made it work with regular subrequests (so 
also with ngx_postgres):
https://github.com/agentzh/nginx-eval-module

Alternatively, you could use ngx.location.capture() feature from ngx_lua 
module to make the subrequests to PostgreSQL location.

I also believe that the first test case from 
https://github.com/FRiCKLE/ngx_postgres/blob/master/t/eval.t might be of 
interest to you.

Best regards,
Piotr Sikora < piotr.sikora at frickle.com >



More information about the nginx mailing list