Force "internal" directive to display a custom 404?

Example:

error_page 404 /404.html;

location = /404.html {
internal;
}

location /alpha {
internal;
}

The proper behavior would be to display the custom 404.html in every
case, which does not.
I’m not sure this could be marked as new feature, or is feasible with
some configuration I don’t know about it?

Thanks.

Posted at Nginx Forum:

Hello!

On Mon, Aug 06, 2012 at 05:31:50PM -0400, TECK wrote:

}

The proper behavior would be to display the custom 404.html in every
case, which does not.
I’m not sure this could be marked as new feature, or is feasible with
some configuration I don’t know about it?

Do you actually have 404.html file under document root? The above
config properly returns custom 404 for “/404.html”, “/alpha”, and
“/alpha/foo” requests here, just tested.

Maxim D.

Hi Maxim,

The problem was located somewhere between my seat and the computer
screen. :slight_smile:
I forgot to add the error_page 404 /404.html; condition into ssl
server… doh.

Regards,

Floren

Posted at Nginx Forum: