502 Bad GateWay error solution

What is 502 bad gateway error

 Simply put, 502 is the wrong gateway with error type code bad gateway. The web server received an invalid response while acting as a gateway or proxy server. In our spoken language, it means that the server running the website is temporarily hung up (not responding).

cause of error

1. The connection timed out and we sent a request to the server. Because the server currently has too many connections, the server cannot give a normal response, and this kind of error is generated.

2. Nginx itself is set to wait for the data delay returned by the cgi interface to be too short, and this time should be extended. As mentioned above, in many cases, it is not the problem of Nginx itself, and this operation often cannot alleviate the problem.

The solution

The best solution is of course to do it on the server, but it is not realistic for everyone, so what I can do is actually very simple, which is to refresh (but it is not a general refresh). The principle of refreshing: Many people may not know that there are two types of refreshing. The so-called refresh is actually to download data from the service to the local hard disk browser, and then read the data from the local hard disk and display it to the browser for us to see. 
 ①Basic Refresh : Just click Refresh or use the F5 shortcut key. 
  Basic Refresh just re-fetches data from the local hard disk to the browser, and does not send a request to the server again. 
  Most users refresh in this way most of the time, and it has no effect when encountering a 502 error. 
 ② Refresh from the server : If you directly click the link of the webpage you want to browse again, you will find that the page that still displayed 502 bad getway just now can be browsed normally again! 
  Do you understand the truth? When you click on the webpage link you want to browse, the data will be re-downloaded from the server. 
 The solution is to refresh from the server: the shortcut key ctrl+F5, so that the request is sent to the server again. 
  If the server can respond normally to you, you can see the page. 

 

Guess you like

Origin blog.csdn.net/ffffffff8/article/details/131918702