This seems to work.
# error_page 404 /404.html; # location = /40x.html { # } error_page 404 /; proxy_intercept_errors on; proxy_redirect off;I'm not sure if this is the correct way to implement it because different articles seem to show variations on the directives but it works.
Thank you for your input on this.