Return JSON for 404 error instead of html

Francis Daly francis at daoine.org
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
http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
with $upstream_http_... in
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#variables

and then use $upstream_http_x_host.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list