openresty / lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers
https://openresty.org/
11.34k stars 2.03k forks source link

support always_forward_headers for ngx.location.capture #2375

Open HanadaLee opened 2 weeks ago

HanadaLee commented 2 weeks ago

According to the documentation: Original request headers should be ignored by setting proxy_pass_request_headers to off in subrequest locations.

However, if proxy_pass_request_headers is used, the headers carried by the headers parameter will also be ignored.

I hope to use a unified location to complete the subrequest, so I hope to be able to control the headers carried to the subrequest in the Lua code (whether to forward the request headers of the main request, the request headers that have been attached, etc.), so I hope to be able to implement the always_forward_headers option, just like always_forward_body.