Start your 3-day free trial
Sign up to experience all premium features at no cost.
*Available only to new users. Each user is limited to one trial.


When a page suddenly shows 502 Bad Gateway, do not assume your phone, computer, or home internet is broken. In most cases, a 502 error means the website's servers failed to talk to each other properly. More specifically, a gateway server did not receive a valid response from an upstream server[1].
Key Takeaways
- It is usually a website-side issue: A 502 error often happens between a gateway, proxy, CDN, load balancer, and the upstream app server.
- Visitors can still troubleshoot: Refreshing the page, clearing browser cache, switching networks, and flushing DNS can rule out local problems.
- Admins need to inspect the backend: Firewalls, DNS, overload, crashed services, and proxy timeouts are the usual suspects.
When you enter a URL, your request often reaches a proxy server, CDN, or load balancer before it reaches the actual website application. That middle layer is the gateway. It forwards your request to an upstream web server, database, or app service.
If the upstream server sends an invalid response, resets the connection, returns malformed data, or fails to respond normally, the gateway cannot complete the request. It then returns a 502 Bad Gateway error[2].
So "Bad Gateway" does not mean your browser is broken. It means the gateway received a bad response. It is different from errors such as DNS server not responding, but both point to a failure somewhere in the request path.
Common causes include:
Even though the issue is usually on the website's side, these seven steps can rule out local causes.
The server may have had a short hiccup. On Windows, press Ctrl + F5. In Safari on Mac, press Command + Shift + R. This forces the browser to bypass local cache and request a fresh page.
Expired or damaged cookies can keep your browser in a bad session state. In Chrome, go to Settings -> Privacy and security -> Clear browsing data, then clear cached images, files, and cookies. If you do not want to lose sessions yet, test the site in Incognito or Private Browsing first.
If Chrome fails, try Edge, Firefox, or Safari. If your computer fails, switch to your phone on mobile data. This A/B test quickly tells you whether the issue is your device, your network, or the website.
Low-quality proxies, free VPNs, or outdated proxy rules can cause websites to reject requests. Turn them off and test a direct connection. If you need a stable VPN, read our complete VPN beginner guide and VPN connection test guide.
DNS is the internet's address book. If your device remembers an old address, it may fail because it cannot find the server IP address.
ipconfig /flushdns.sudo killall -HUP mDNSResponder.Unplug your router and modem, wait about 30 seconds, and plug them back in. This clears temporary NAT states, refreshes your connection, and can fix local network hardware issues.
If the first six steps do not help, the website is probably having a server-side problem. Search the site's name on social platforms, or check it with Down for Everyone or Just Me.
As a visitor, you cannot fix someone else's server, but you can reduce local triggers.
If you run the website, a 502 is a backend incident signal. Start here:
error.log files first.systemctl status <service>, PM2 status, container logs, or your process manager to see whether Node.js, PHP, Java, or other services crashed or restarted after OOM[4].curl -v localhost:<port> are useful.proxy_read_timeout only after confirming the workload.No. A 502 is a remote server communication error. It does not spread malware by itself and does not mean your device was hacked.
It depends. A short overload may clear in minutes. A bad deployment, data center issue, or crashed backend can take hours.
A 502 means the gateway received a bad response from upstream. A 504 means the gateway waited for upstream until the request timed out. Both involve gateways, but the failure mode is different.
Use the same logic as on a computer. Clear Safari or Chrome browsing data, switch between Wi-Fi and mobile data, or toggle Airplane Mode so the phone reconnects to the network.
Usually no. A 502 normally happens on the website or cloud service side, outside your ISP's control. Consider calling your ISP only if many unrelated websites fail at the same time.
Disclaimer This article is for general informational purposes only. The tools, commands, and troubleshooting steps mentioned here are general guidance. If you are on an enterprise network or a custom environment, consult your IT team first.
The AethoVPN editorial team publishes “What Is a 502 Bad Gateway Error Quick Fixes”; it is not a VPN solution.
Sources
Related Articles:
Sign up to experience all premium features at no cost.
*Available only to new users. Each user is limited to one trial.