Why does NGINX report error 502?

Source: Internet
Author: User
Why does NGINX report 502 error recently modify a website of the company and add a page. It is OK during offline testing, but 502 & nbsp; Bad & nbsp; Gateway is displayed online. I optimized the code again. The page loading speed was very fast during offline loading, but the loading speed was slow and time-out. Then an error is reported ------ solution ------------ Why does NGINX report a 502 error?
Recently, I modified a website of my company and added a page. Click OK during offline testing, but the 502 Bad Gateway is displayed online.

I optimized the code again. The page loading speed was very fast during offline loading, but the loading speed was slow and time-out. Then an error is reported.


------ Solution --------------------
Solution to 502 bad gateway error
For more information
1. what is error 502 bad gateway?
In short, 502 is the gateway with the error type code bad gateway.
2. cause of error
When the connection times out, we send a request to the server. because the server has too many connections, the server cannot provide a normal response, resulting in such an error.
3. solutions
The best solution is to do it on the server, which is unlikely for everyone.
So what are our solutions?
To put it bluntly, it's easy.
-Refresh (not a general refresh)
Refresh principle: Many people may not know that there are two types of refresh.
The so-called refresh is actually to download data from the server to the local hard disk browser,
Read the data from the local hard disk and show it to the browser.
① Basic refresh: click refresh or use the F5 shortcut key.
Basic refresh only retrieves data from the local hard disk to the browser and does not send a new request to the server.
Most users refresh this frequently and report 502 errors without any effect.
② Refresh from the server: If you click the link of the web page you want to browse again, you will find that the 502 bad getway page is still displayed and can be viewed again now!
Why? When you click the webpage link you want to browse, the data will be re-downloaded from the server.
The solution is to refresh the server: press ctrl + F5 to send a new request to the server.
If the server can respond to you normally, you can see the page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.