Error_page at http context

I can’t get error_page override default error pages when using it in
HTTP
context (rather than server {} / location {}).
Can someone share a real-world working example?

Posted at Nginx Forum:

On Fri, Jun 12, 2015 at 07:13:08PM -0400, iamnginxer wrote:

Hi there,

I can’t get error_page override default error pages when using it in HTTP
context (rather than server {} / location {}).

What did you try?

Can someone share a real-world working example?

http://nginx.org/r/error_page

==
http {
error_page 404 /404.html;
server {
listen 8080;
}
}

$ echo my-404 > html/404.html

$ curl http://127.0.0.1:8080/not-there
my-404

f

Francis D. [email protected]