Extract headers/body from subrequests

agentzh agentzh at gmail.com
Sun Oct 28 18:44:45 UTC 2012


Hello!

On Sat, Oct 27, 2012 at 9:59 PM, R. Tyler Croy wrote:
>
> I'm using the auth_request module from Maxim Dounin as a basis for some of my
> experimenting.
>
> What I'm trying to do at the end of the day is bring a header from the response
> of a subrequest and feed it into the headers_in for the "main" request, but I
> can't figure how this works.
>
> The code I'm focused most on is in the ngx_http_auth_request_handler function:
>

You can take a look at how our ngx_lua and ngx_srcache modules do this:

    http://wiki.nginx.org/HttpLuaModule#ngx.location.capture
    http://wiki.nginx.org/HttpSRCacheModule#srcache_fetch

I think maybe you can just use ngx_lua's access_by_lua directly
without writing your own C module for your task ;)

Best regards,
-agentzh



More information about the nginx-devel mailing list