Nginx custom 404 error page configuration

Source: Internet
Author: User
The nginx custom page is very simple and can be done with two commands. add the red command in the http {} segment, as shown in the following http {... fastcgi_intercept_errorson; error_page404/404.html ;...} 2. put the 404 page... the nginx custom page is very simple and can be done with two commands. add the red command in the http {} segment, as shown in the following http {... fastcgi_intercept_errors on; error_page 404/404 .html ;...} 2. place the 404 page in the root directory (defined by the root command). the default directory is the html Directory of the installation directory. 3. test whether the configuration is correct/usr/local/nginx-t 4. reload and configure kill-HUP 'cat/usr/local/nginx. pid 'Note: The custom 404.html content must be greater than 512 bytes. Otherwise, the default 404 error page is displayed in ie, and the custom 404 page is not displayed. If your version is smallerAdd the following content to the tag to block the default browser error prompt.  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.