I have been studying the nginx source code and read through Emiller's
guides and I'm interested in doing something more general than I have
learned about so far.
Say I have a location /url that I want to construct responses to based
on a sequence of communications with an upstream, host:port. To be
specific, the upstream would be a database, and the sequence of
communications would comprise commands and responses. A simple example
of what I'd like to do would be:
1. client communicates message to /url meaning "if key foo exists,
add 1 to bar"
2. module handling /url sends first database command to check if foo
exists, if not reply "failed" to client, or it does and
3. module sends database command to increment bar, replies "succeeded".
The details are arbitrary, but I would think there are myriad examples
where you'd want a module to construct a reply based on back and forth
I'm hoping there's some nice way of handling this case, but from I've
gathered looking at the code it seems oriented to "1 message to
module, filter as desired, send to upstream, get response, filter
again, then response back to client."