error_page behavior

Francis Daly francis at daoine.org
Mon Apr 4 19:54:12 UTC 2016


On Mon, Apr 04, 2016 at 09:36:36PM +0200, B.R. wrote:

Hi there,

> I am struggling to understand the error_page directive behavior:

I do not get the full same results that you report, when I use 1.9.2.

> Expected behavior:
> ->Request to http://example.com/proxy
>     -> Sub-request to http://example.org/proxied
>     -> Response HTTP 418
> -> Error page for HTTP 418 served http://example.com/error_page.html

No. Your "error_page" with "=" eats the 418 status.

> Observed behavior:
> -> Request to http://example.com/proxy
>     -> Sub-request to http://example.org/proxied
>     -> Response HTTP 418

I do get that much.

> -> Error page HTTP 404 (???)

I only get 404 if error_page.html does not exist. If it does exist,
I get it with http 200.

Aside from that: I suspect that proxy_intercept_errors does exactly the
opposite of what you think it does.

What happens if you set it "off"?


> What am I doing/understanding wrong?

error_page normally does not change the http status. Your extra config
told it to change it.

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list