Static page custom error html

Hello, I am running a static page on MIAB. How can I configure nginx to use a custom error page?

There is also an unofficial configuration file that I am using, and I tried adding the
error_page 404 /404.html; to it, but it didn’t work.

Currently the mypage.conf file looks like this:

  location ~* \.php$ {
    include fastcgi_params;
    fastcgi_pass php-fpm;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    error_page 404 /404.html;

 }

Any ideas?

Got it working with the help of this post: