Nginx system errors are uniformly redirected to the error page

server{
        #Listener port 8081
        listen 8081;
        #Corresponding domain name, just change baofeidyz.com to your own domain name
        server_name localhost;
      
        proxy_intercept_errors on;
        error_page  404  /404.html;
        location = /404.html {
            # 404.html location
            root   /usr/local/nginx/html;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
             # 50x.html location
            root   /usr/local/nginx/html;
        }
        location / {
            root /usr/local/nginx/html;
            #Homepage file
            index index.html;
        }
        location / { 
           proxy_pass http://127.0.0.1:8081;
           #Set the response timeout to 3 minutes
           proxy_read_timeout 180;
       }
       
    }

Guess you like

Origin blog.csdn.net/weixin_42228950/article/details/106014353