502, 503 and 504 Proxy Errors: Whose Problem Is It?
502, 503 and 504 are all sent by a server sitting between you and the page: a gateway, a proxy or the site's own front end.
502 means that server received an invalid response from the server behind it, 503 means it is not ready to handle the request (usually maintenance or overload, and meant to be temporary), and 504 means it got no response in time.
With HTTPS, only the answer to the CONNECT request comes from the proxy; once the tunnel is open the status comes from the website. So run curl with -v: a 5xx on the CONNECT line is the proxy side, a 5xx after a successful CONNECT is the website's side. A SOCKS5 proxy does not send HTTP status codes at all.
Example addresses (203.0.113.0/24), not real exits
01 / 08Who can send a 5xx between you and the page
The status code alone does not say who sent it. Where it appears in a curl trace does.
01
Who can send a 5xx between you and the page
There are up to three parties: your client, the proxy and the website (often with its own gateway or CDN in front). A 502, 503 or 504 is sent by whichever party sat between the sender and the server it needed, so the same number can come from the proxy or from the website's front end.
With an HTTP proxy and an HTTPS page, the client first sends CONNECT host:port. Only a 2xx answer opens a tunnel; any other status means no tunnel, and that status came from the proxy. After that the proxy relays bytes without reading them and TLS runs between you and the site, so every status you see next came from the site. A SOCKS5 proxy replies with its own reply codes, not HTTP status codes, so a 502, 503 or 504 over SOCKS5 can only come from the site or a gateway in front of it.
For a plain http:// page the proxy reads and forwards the request, so the code alone cannot tell the two apart. Look at the headers and the body of the error page: they sometimes name the gateway that sent it.
The gateway or proxy received an invalid response from the server behind it
On the CONNECT line: the proxy side. After a successful CONNECT: the website's front end
503 Service Unavailable
The server is not ready to handle the request, usually maintenance or overload; meant to be temporary
Read Retry-After if it is there, wait, and test another page through the same proxy
504 Gateway Timeout
The gateway or proxy got no response in time from the server it needed
Open the page without the proxy; if it is slow there too, the site is the cause
Source: MDN pages for 502, 503, 504 and the CONNECT method, read on 20 November 2026. The last column is a reading order, not a rule: a gateway in front of the website can send the same codes.
Run the first two commands in the next block with the page that fails. The first shows the CONNECT request and every response line; the second prints two numbers, the proxy's answer to CONNECT and the site's answer.
Expected result A 2xx connect value and a 5xx site value means the website sent it; a 5xx connect value means the proxy side.
Before continuing Remove your login and password before you paste a trace anywhere.
Step 2: open the same URL without the proxy
Run the third command, on the same network. If it fails or is slow too, the website or your network is the cause, not the proxy.
Step 3: try another page through the same proxy
Replace the URL in the second command with a page you know is up. If it returns 200, the proxy path works and the first site is the problem.
Step 4: run it again to get a new IP
On rotating residential a new connection gets a new IP by default, so running curl again tests a different exit. If a session pins one IP, start a new session. A code that follows the site on every IP is the site's; one that appears on only some IPs points to those IPs.
Step 5: retry slowly
For a 503 wait at least as long as Retry-After says, if the header is there. For 502 and 504 wait a little, then try again. Stop after a few attempts instead of looping, because a site that is overloaded gets worse under repeated requests.
Step 6: if the CONNECT line shows a 5xx, write to Support
Send the order number, the time, the exact command without your password, and the lines it printed. A failed IP is reissued after a Support ticket with the order number.
04
Read the CONNECT line with curl
# 1) Show the CONNECT request and every response line (HTTP proxy, port 2222)
curl -sv -o /dev/null -x "http://LOGIN:PASSWORD@HOST:2222" https://example.com/ 2>&1 | grep -E "^(> CONNECT|< HTTP/)"
# 2) Print the proxy's answer to CONNECT and the site's answer
curl -s -o /dev/null -w "proxy CONNECT: %{http_connect} site: %{http_code}\n" -x "http://LOGIN:PASSWORD@HOST:2222" https://example.com/
# 3) The same URL without the proxy
curl -s -o /dev/null -w "direct: %{http_code}\n" https://example.com/
Example only: replace LOGIN, PASSWORD and HOST with the values from My assets and example.com with the page that fails. These commands apply to the HTTP port; over SOCKS5 there are no HTTP codes from the proxy.
05
Symptoms and what to do
Every site gives 502, 503 or 504 through the proxy, and none does without it
Check What does the connect value in command 2 show, and does the same login work in curl on another network?
Fix If connect is 5xx on every site, write to Support with the details from step 6.
Stop when Do not keep retrying in a loop; it adds load and changes nothing.
Only one site gives the error through the proxy
Check Is the connect value 2xx and the site value 5xx, and does the page also fail without the proxy?
Fix The site sent it. Wait, check its status page if it has one, and try another IP.
The same URL fails with and without the proxy
Check Does the direct command also print a 5xx?
Fix The proxy is not involved. Wait for the site, or check your own network.
It fails on some IPs and works on others
Check Does the code follow the IP or the site? Run command 2 three or four times and note the connect and site values.
Fix If it follows the IP, pick another IP or country; if it follows the site, wait.
curl prints 407 instead of 5xx
Check 407 means the proxy wants valid login details.
Fix Re-copy the login and password from My assets; the 407 guide has the steps.
06
Which Proxy302 option for scraping that meets 5xx
Rotating residential gives a new IP on every new connection by default, so a retry usually leaves from a different IP. With a session you hold one IP instead. The Budget line costs US$1.50 per GB from 1 GB and takes only a country; the Premium line costs US$5 per GB and can be chosen down to state and city. Purchased traffic has no expiry, and the entry is proxy.proxy302.com, HTTP port 2222, SOCKS5 port 3333.
There is no free trial; the smallest purchase is 1 GB of rotating residential traffic. A website's 5xx is not fixed by a different proxy, so slow your request rate first and rotate second.
What does a 502 Bad Gateway mean when I use a proxy?
A server acting as a gateway or proxy received an invalid response from the server behind it. Read the CONNECT line to see whether the proxy or the website sent it.
It can be either. It means the server is not ready to handle the request, commonly from maintenance or overload. Test another page through the same proxy and the same page without it.
When a proxy won't connect or is slow, check six things first: address, port and type, login and password, one proxy app only, the antidetect browser port, the exit IP.
Read on 20 November 2026: 502 means a server acting as a gateway or proxy received an invalid response from the server behind it; if the origin sends a valid HTTP error response the gateway should pass it on rather than replace it with 502; if the gateway got no HTTP response it should send 504.
Read on 20 November 2026: 503 means the server is not ready to handle the request, commonly because of maintenance or overload; it is meant for temporary conditions and may carry a Retry-After header with seconds or an HTTP date.
Read on 20 November 2026: 504 means a server acting as a gateway or proxy did not receive a response in time from the server it needed; the intermediary sends it, not the origin; with a 502 the gateway got an invalid response, with a 504 none within the time limit.
Read on 20 November 2026: the client sends CONNECT host:port and the proxy opens a TCP tunnel and relays bytes without reading them, so TLS runs between the client and the website; only a 2xx response switches the proxy to tunnel mode, any other status means no tunnel was established.
Read on 20 November 2026: a SOCKS5 server replies with a one-octet REP field (succeeded, general failure, connection not allowed, network unreachable, host unreachable, connection refused, TTL expired, and so on), not with HTTP status codes.
Checked on 20 November 2026 in the curl 8.7.1 manual: the http_connect variable is the numerical code found in the last response from a proxy to a curl CONNECT request; http_code is the response code of the transfer. The commands in this guide were checked for syntax only.
Proxy302 line tests, 11 November 2026
Product observation · Confirmed on:
Rotating residential: without a session every new connection gets a new IP (not every request); a reused keep-alive connection keeps its IP; with a session one IP is held. The Budget line lets you pick a session of 1 to 120 minutes and only a country; the Premium line can be chosen down to state and city.
Proxy302 product facts and price list
Product observation · Confirmed on:
Product facts file of the site (values checked on 10 November 2026): protocols and ports, prices in US$ (1 PTC = US$1), lease terms, quantity limits, no free trial.
Ready to try it?
Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.