Lnmp is the Web architecture of Linux + nginx + MySQL + PHP.
1. In the website's root directory touch file 404.html, the content is as follows:
<HTML>
<Body>
</Html>
2. cHmod 755 404.html
Chown www: www 404.html
3. Modify the nginx configuration file nginx. conf:
Add fastcgi_intercept_errors on in the HTTP {} region;
Add error_page 404/404 .html in server;
4. Restart nginx web server.
5. Enter the wrong address in the IE Address Bar and the Error 404 page will be returned. Shown as follows:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/42/FF/wKioL1PZCZnjsfHKAADDYK9rsUg690.jpg "Title =" lnmp404error page .jpg "alt =" wkiol1pzcznjsfhkaaddyk9rsug690.jpg "/>
6. The error_page command is used to set the URI address returned to the client if a specified HTTP Error status code is displayed.
7. Configure the error_page command, for example:
Error_page 404/404 .html;
If the page responding to the error code is a FastCGI program such as PHP, it is best to add the = sign in error_page.
Error_page 404 =/404.php;
If you want to return the original error status code, remove the = in the error_page command.
Error_page 404/404 .php;
This article from the "Lin Xi" blog, please be sure to keep this source http://lutaoxu.blog.51cto.com/4224602/1532999