Internal and error_page directives

Hi, today I’ve noticed a strange thing regarding “internal” and
“error_page” directives.

I have a config similar to this:

location ~ {
internal;
proxy_pass ;
error_page 404 = /other_location$uri;
}

What I’m surprised about is that if an external request comes to this
location, we go the /other_location. So the 404 that results from
“internal” is also subject for error_page processing. Isn’t that
strange? I cannot find any documentation about that.


Filipp

Hello!

On Thu, Oct 16, 2014 at 08:26:55PM +0400, Filipp Gunbin wrote:

What I’m surprised about is that if an external request comes to this
location, we go the /other_location. So the 404 that results from
“internal” is also subject for error_page processing. Isn’t that
strange? I cannot find any documentation about that.

If a location with “internal” keyword is selected for an external
request, the 404 error is generated. The error is handled as
usual, and it’s subject to error_page processing if one is
configured.

The documentation is here:

http://nginx.org/en/docs/http/ngx_http_core_module.html#internal


Maxim D.
http://nginx.org/

On 16/10/2014 22:22 +0400, Maxim D. wrote:

If a location with “internal” keyword is selected for an external
request, the 404 error is generated. The error is handled as
usual, and it’s subject to error_page processing if one is
configured.

The documentation is here:

Module ngx_http_core_module

Thanks, of course I’ve read it before.

It just happened that I was erroneously thinking of “internal” as a
“reject-and-stop-processing” kind of directive. Now I see I was wrong.
Maybe that should be stressed in the documentation to prevent the
possible confusion.


Filipp