Can NGINX add an empty payload

Maxim Dounin mdounin at
Fri Aug 8 17:15:58 UTC 2014


On Fri, Aug 08, 2014 at 12:49:07PM -0400, matt_l wrote:

> Hello
> I have taken the NGINX training but the following question was not covered.
> I am hoping I can get some help from the community. Thank you in advance.
> Can NGINX add empty (or static non empty) payload to a request when proxying
> to a server in the Location directive (or elsewhere)
> For example
> Client => NGINX => Server
> Client sends
> NGINX adds -d '{"version": "1.1"}' -H "Content-Type: application/json"
> Server receives -d '{"version": "1.1"}' -H
> "Content-Type: application/json"
> The reason why I am asking is because I have a client that sends requests
> without payload and the server expects that payload exists (even if it does
> not get processed)

This should be possible with proxy_set_header and proxy_set_body, 
see here:

Maxim Dounin

More information about the nginx mailing list