Nginx error_page custom error page setting code tutorial, nginxerror_page
Nginx error_page custom error page setting code tutorial
# Fastcgi_intercept_errors on; # Syntax: fastcgi_intercept_errors on | off # default value: fastcgi_intercept_errors off # Use Field: http, server, location # This command specifies whether to pass 4xx and 5xx error messages, alternatively, nginx can use error_page to process error messages. # You must explicitly specify the processing method in error_page to make this parameter valid, as Igor says, "If no proper processing method is available, # nginx will not block an error, this error does not display its default page. You can use some methods to block the error. # If proxy_intercept_errors is on, nginx follows the original response # proxy_intercept_errors on | off # proxy_intercept_errors off # use fields: http, server, location # code output. The backend is 404, Which is 404. this variable can be used to customize the error page. Proxy_intercept_errors on; upstream dev1 {server 127.0.0.1: 8080; # HessianTest3} server {listen 80; server_name kevin.com; location/{proxy_pass https: // dev1; # HessianTest3} # reference book page 40th # error_page 404 = 200/404 .html; # error_page 500 502 503 = 504 x.html; # location =/404.html {# root html; ##}# location =/50x.html {# root html; #}# when a page exception occurs, you can specify to jump to location, you can also specify to jump to the specified URL above error_page 404 https://www.baidu.com /;}