1、在http段添加:fastcgi_intercept_errors on;


2、在server段添加:error_page 404 = /404.htm;