Return JSON for 404 error instead of html

Francis Daly francis at
Thu May 15 07:17:58 UTC 2014

On Wed, May 14, 2014 at 06:38:45PM -0400, justink101 wrote:

Hi there,

> If I try and
> fetch a header that I know is being returned from the proxy it is
> undefined.
> location @four_o_four {
>     internal;
>     more_set_headers "X-Host: $sent_http_x_host";

What value do you think $sent_http_x_host has, and why do you think that?

Compare $http_name and $sent_http_name in
with $upstream_http_... in

and then use $upstream_http_x_host.

Francis Daly        francis at

More information about the nginx mailing list