Setting a custom header on a proxied request

Maxime Henrion mhenrion at
Wed Oct 14 16:13:10 UTC 2015

Hey all,

I'm now contemplating implementing a full-blown upstream module instead of using the proxy module to achieve my goals here. Does that sound like a sensible solution?

Also, if I do go down that road, is it possible to have subrequests that use different upstreams? In order to send multiple requests for a single incoming request, I currently use a dummy location handler in the configuration, that invokes the "proxy_pass http://$arg_host" directive, and issue multiple subrequests to that location. Will I still need to do something similar with my own upstream module, or can I somehow create subrequests with different r->upstream pointers and have everything work as intended? From what I gathered so far, I don't quite see where the subrequest handling code would call ngx_http_upstream_init().

Thanks in advance,

More information about the nginx-devel mailing list