|
A custom error page
Under 1. Create a 404 error page on the web root directory
12 vim 404.html
welcome, my name is 404
2. http {nginx.conf file} defining area added:
fastcgi_intercept_errors on;
This command is used to decide whether the client turned 4xx and 5xx error page,
3.error_page command to specify the error page, you can http {}, server {} Add
error_page 404 = /404.html;
error_page command syntax:
error_page 502 503 504 /50x.html; # 502,503,504 If you encounter an error status code, the display file contents /50.html
error_page 403 http://example.com/forbidden.html;# encounter 403 errors, jump to the specified url address
error_page 404 = 200 /empty.gif; # 404 encountered an error status code, the status code to 200, and displays the contents of the documents to the client
Custom error page summary:
You must add fastcgi_intercept_errorson; the
Custom 404 page larger than 512 bytes must be, otherwise there will be IE the default 404 page |
|
|
|