Really, truly controlling Nginx error pages

I have googled and searched through this forum.

But this syntax in the config file does NOT help:

# recursive_error_pages on;
error_page 403 404 500 502 503 504  /error.htm;

It works sometimes, but often it just shows me the stock Nginx page.

How do I avoid this once and for all, or is this impossible?

Posted at Nginx Forum: