Create a Request from a String

agentzh agentzh at gmail.com
Wed May 26 05:39:20 MSD 2010


On Wed, May 26, 2010 at 2:14 AM, Matthieu Tourne
<matthieu.tourne at gmail.com> wrote:
>
> Thanks for the pointers, but it doesn't really answer my question.
> Agentzh's post shows how to send the content fetched from memcached to the
> downstream.

Aye :)

> I'm trying to send that content representing a request, to an upstream.
> Basically "replaying" a query stored as a string, exactly as if it was
> coming from an open socket.

Basically it's boiled down to manipulating r->headers_in and
r->request_body in a rewrite or access phase handler and then forward
to request object to the upstream handler (remember upstream is a
content handler pe se?) :)

ngx_headers_more has the code for the former while ngx_chunkin and
ngx_echo do have some examples for the latter :)

Cheers,
-agentzh



More information about the nginx mailing list