Troubleshooting Center
Menu
← All guides

Machine translation · Korean original

HTTP 502 troubleshooting steps for visitors and site owners

Browser displaying 502 Bad Gateway response from nginx in product detail address
Example of scene reproduction

HTTP 502 error means that the server relaying the browser's request did not receive a response that could be processed properly by the server behind it.

If you see ‘502 Bad Gateway’ while reading the article, open the same address again after a while. If you are right after pressing the payment or application button, check the order/reception details first.

502 Range indicated by the screen

Let's say you open the product page of a shopping mall. The gateway that receives the browser's request forwards the request to the application server that creates product information.

If that connection is lost mid-response, the gateway may send a 502 error screen instead of product information.

Just because your browser displays an error page doesn't necessarily mean that the product servers are down.

Screen confirming the GET request and 502 Bad Gateway status in the header of the product detail request
Example of scene reproduction

The gateway role is played by CDN, load balancer, reverse proxy, etc. A site may use multiple relay stages.

Therefore, even if a specific company name is listed on the error page, you must separately check whether that company is the cause of the error.

code on screen The situation the code refers to
502 Bad Gateway The relay server does not get a valid response from the back server
503 Service Unavailable It is difficult for the service to process current requests due to maintenance or overload.
504 Gateway Timeout The relay server does not receive the response from the rear server in time.

What do visitors check before closing the screen?

  1. Check the failed operation. If you were looking for a product description or article, please wait a moment and open the address again. Once you have submitted your order, transferred money, and confirmed your reservation, proceed to the next step.
  2. Open your transaction history in a new tab. Once you have your order number or receipt number, do not press the button again on the tab that displays the error. If you see payment approval but no order, write down the approval time and amount and check with customer service.
  3. Try opening another read-only page. The homepage and announcements are opened and checked to see if only certain products are failing. You should not assume that the order has been processed normally just because the home page has been opened.
  4. Check service status notices. If the announced time of failure overlaps with the time you experienced, check the page that first failed after receiving recovery instructions.

If it repeats only on your device, try opening the same public page using mobile data on your phone. If it only fails on Wi-Fi, the network used and whether or not a VPN is used are clues to the inquiry.

If it is a company network, please convey the address and time of occurrence to the in-house representative before changing security settings.

When inquiring, it is more accurate to say “If you open the product detail page at 2:10 PM Korean time, 502 will appear, and the home page will open at the same time” rather than “The site does not work.”

If there is a request ID on the screen, write it down as well. When attaching a screen, the address's login token, orderer's contact information, and payment information are hidden from view.

Operators try to match records of the same request back and forth

Failure time and time zone, path, and request ID Find the request in your gateway access log. Record the final status code, upstream address, upstream status, and response time.

The text the visitor sees and the gateway's own error log contain different information. Make sure both records have the same clock and time zone.

A screen that searches by request ID r7f21 and compares the app's processing start, gateway connection termination, and 502 record in chronological order.
Example of scene reproduction

Check if the request reaches your app. If the same request ID is in the application log, check if there is a record of response completion after processing starts.

If there is a record that the process was restarted or disconnected just before completion, check the reason for termination and resource usage of the instance.

If there are no requests in the app log, first check whether the route is usually recorded. Then read the connection error on your gateway.

If ‘connection refused’ remains, check whether the service is listening on the configured address and port.

If TLS negotiation failed, check that the host name and certificate used to connect to the source match. Where to investigate depends on the error wording.

Compare one successful request and one failed request. If the same path succeeds and fails alternately, see which upstream instance both requests were directed to.

If it only fails on a specific instance, check the health check result of that instance and the latest deployment version.

If only one route fails across all instances, start by looking at route-specific routing or app logs for that feature.

If the latest deployment and failure time overlap, narrow down the items that have changed.

For example, if only the app's listening port changes and the gateway looks at the old port, external requests may fail even though the app's own health check passes.

You can see this difference by comparing the destination address of the gateway that actually receives the request with the receiving address of the currently running app.

Check recovery from the first failed path.

After editing, perform the same read operation on the public address used by the visitor. If you only check the success response on the homepage and then finish, you may miss any remaining errors on the detail page or API.

Verify that the screen content is displayed to the end and that there is a record of normal completion in both the gateway and app logs at the same time.

When executing it again like a payment, check the processing status of the existing transaction first to determine the path where the actual transaction occurs. If reproduction is required, use test ordering means.

If it was an intermittent failure, you need to check whether the number of 502s on the same path does not increase again even after the requests are distributed to multiple instances to determine whether it can be recovered.

502 Definition of HTTP Standard RFC 9110 · MDN's 502 response description and example

official help

Check official documentation ·

Inspection information

public status
public
Document inspection date
Scheduled for next review
direct reproduction
no record

This article was written based on official documents. We don't represent things as if we experienced them unless we reproduced them ourselves.