I set error page as
error_page 404 = 404.php;
or
error_page 404 = /404.php;
in both cases, it will load 404.php when visiting a non-existent page in the main directory as domain.com/not-exist.html; but it will not work for domain.com/sub-dir/not-exist.html
How I can set Nginx to redirect to 404.php when visiting any missing page?