Nginx set 404 500 page to jump to the specified page

By default, nginx does not support custom 500 and 400 pages;

Modify the configuration file conf/nginx.conf to add page redirection and add a line to http;

fastcgi_intercept_errors on;


Add a line to specify the error page in the service

error_page 404 500 = /error.html; or

error_page 404 = http:// your domain name; [remind to write http here ]

Then test it out:

your installation directory /nginx/sbin/nginx -t 
your installation directory /nginx/sbin/nginx -s reload







Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325978309&siteId=291194637