502 Bad Gateway is a manifestation of a communication error with the website server. 502 is an error type code. It cannot indicate what is wrong with the website. When the server encounters a problem and the customer browses the web page, the web page will display 502 Bad Gateway.
This usually does not mean that the upstream server is down (unresponsive gateway/proxy), but rather that the upstream server and gateway/proxy do not agree on a protocol for exchanging data. Given that the Internet protocol is fairly well understood, it often means that one or two machines have been incorrectly or incompletely programmed.
Some solutions:
Check server connection
Most websites are run through multiple servers or third-party proxies. If the server you are on is shut down due to maintenance or other reasons, a 502 Bad Gateway Error page may appear on your website. The only solution is to wait for the server to complete maintenance or fix the fault.
Check if the DNS has been changed
If you have recently changed the host server or moved the website to another IP address, the DNS server of the website will be changed. This may cause the website to be inaccessible and a 502 Bad Gateway Error page appears. Before these DNS changes are completed, it may take a few minutes for your website to be up and running.
Check the server log
The task of the server's diary is to record the entire process of the website being accessed, who has visited it at what time, what search engines have visited it, and whether it has been included. your web page. You can use it to check the health status of your website. Careful inspection of the log contents may reveal the problem.
Fix firewall failure
The website firewall is equivalent to the guardian of the website, protecting your website from the intrusion of illegal users and distributed denial of service (DDOS) attacks. Sometimes, incorrect firewall settings cause the firewall to treat access requests coming from the content delivery network (CDN) as an attack on the server and therefore deny access, resulting in a 502 Bad Gateway.
The above is the detailed content of What does error code 502 mean?. For more information, please follow other related articles on the PHP Chinese website!