Knowledgebase Help Center

Understanding and resolving a 502 Bad Gateway response

Understanding and resolving a 502 Bad Gateway response is a practical Spark Rack customer guide about website roots, HTTP behavior, PHP, application settings, and web-server responses. It is written for readers who may not administer servers every day, but who still need enough detail to understand what a setting or error means, make a safe change, verify the result, and know when the problem must be escalated.

Use the exact values displayed for the selected account, domain, mailbox, database, or hosting service. Hostnames, usernames, ports, paths, limits, and available controls can differ by product. Never substitute a value copied from another service merely because the labels look similar.

What the message means

A proxy or front-end server received an invalid response from an upstream application or process.

Start with the correct service and evidence

In ECP, begin in Services, Websites, PHP, logs, SSL, files, and domain settings. Record the current value before changing it. A useful troubleshooting record separates what is known from what is assumed and preserves the exact timestamp of every test.

StepCheckPurpose
1Test the exact URL and note the HTTP status code.Identity and scope
2Confirm the active document root and whether a static test file loads.Current configuration
3Review web-server and PHP logs at the same timestamp.Independent test
4Undo the most recent file, PHP, redirect, or application change when the failure began immediately afterward.Evidence and rollback

Most common causes

  • an unavailable PHP or application process.
  • a crashed upstream service.
  • a proxy configuration mismatch.
  • resource exhaustion.
  • a temporary restart or deployment window.

Step-by-step resolution

  1. Check Status Center and service notices.
  2. Retry once after a short interval.
  3. Test a static file and a dynamic page separately.
  4. Review application and proxy logs.
  5. Escalate with timestamps when the upstream process is provider-managed.

Do not make the problem harder to diagnose

  • Do not change several hostnames, passwords, records, permissions, plugins, or redirects at once.
  • Do not delete the failing configuration before preserving it.
  • Do not repeatedly retry a payment, transfer, migration, or destructive operation without reading the current status.
  • Do not permanently accept an unexplained certificate or host-key mismatch.
  • Do not disable security controls globally merely to see whether the error disappears.
  • Do not send credentials in screenshots or ticket text.

How to verify the fix

  1. Repeat the smallest test that originally failed.
  2. Test from a clean session or independent client.
  3. Confirm the customer-facing result, not only the saved setting.
  4. Observe long enough to catch queued processing, propagation, synchronization, or recurrence.
  5. Remove temporary workarounds and document the final value.

What to include in a support request

Provide the affected service, domain, mailbox, database, URL, or username; the exact error; timestamp and time zone; client and operating system; the last known-good time; recent changes; whether another device or network works; and the result of each controlled test. Redact passwords, recovery codes, private keys, and unrelated personal information.

Reference checklist

  • Test the exact URL and note the HTTP status code.
  • Confirm the active document root and whether a static test file loads.
  • Review web-server and PHP logs at the same timestamp.
  • Undo the most recent file, PHP, redirect, or application change when the failure began immediately afterward.
  • Also consider whether the request is reaching the wrong website or document root.
  • Also consider whether a recent file or application change introduced an error.
  • Also consider whether PHP or a required extension is incompatible.

Security and change-control notes

Use a unique credential for each service identity, store it in an approved password manager, and remove access when a person or vendor no longer needs it. Before editing production data or configuration, keep a restorable copy and a record of the original value. Do not expose passwords, private keys, payment data, recovery codes, or full database contents in screenshots or normal support messages.

After the task is complete, verify renewal dates, notification recipients, and dependent services. Many recurring problems are caused by a technically correct change that was never updated in a second client, application configuration file, DNS provider, forwarding rule, scheduled task, or external integration.

Extended diagnostic sequence

  1. Confirm scope: one user, one device, one network, one domain, one mailbox, one database, one service, or all customers.
  2. Record the last known-good time and every relevant change after it.
  3. Check account and service lifecycle status, billing status, permissions, and notices.
  4. Test the most direct supported connection without optional plugins, proxies, caches, or integrations.
  5. Compare the working and failing paths one variable at a time.
  6. Preserve exact logs and responses before clearing caches or resetting credentials.
  7. Restore the last known-good value when the failure began immediately after a reversible change.
  8. Retest from an independent client or network and observe for delayed processing.
  9. Document the final cause and remove temporary workarounds.

Controlled comparison matrix

When the first test does not identify the cause, compare the result across a small matrix instead of making another configuration change. Test the same account or resource from a second device, then test a second known-good account or resource from the original device. When possible, repeat the test on another network. This separates account-specific, service-specific, client-specific, and network-specific failures.

ComparisonWhat a different result suggests
Same item, different deviceThe original client, saved credential, browser state, firewall, or operating system may be responsible.
Different item, same deviceThe problem may be limited to one service, mailbox, domain, username, path, or database.
Same item, different networkDNS resolver, ISP routing, VPN, proxy, firewall, or IPv6 behavior may differ.
Authoritative or server-side test versus normal client testA cache, application layer, or local configuration may be hiding the current server state.

Record each result before continuing. A two-minute comparison often provides more useful evidence than repeatedly resetting passwords, recreating records, changing permissions, or reinstalling software.

Was this article helpful?

Related Articles

More guides from the same categories.

Finding and fixing an .htaccess syntax errorFinding and fixing an .htaccess syntax error is a practical Spark Rack customer guide about website roots, HTTP behavior, PHP, application settings, and web-server responses. It is written for readers who may not admini… Fixing a 403 Forbidden error on a hosted websiteFixing a 403 Forbidden error on a hosted website is a practical Spark Rack customer guide about website roots, HTTP behavior, PHP, application settings, and web-server responses. It is written for readers who may not ad… Fixing a 500 Internal Server Error on a PHP websiteFixing a 500 Internal Server Error on a PHP website is a practical Spark Rack customer guide about website roots, HTTP behavior, PHP, application settings, and web-server responses. It is written for readers who may not… Fixing a blank white page or empty PHP responseFixing a blank white page or empty PHP response is a practical Spark Rack customer guide about website roots, HTTP behavior, PHP, application settings, and web-server responses. It is written for readers who may not adm… Fixing an endless HTTP-to-HTTPS redirect loopFixing an endless HTTP-to-HTTPS redirect loop is a practical Spark Rack customer guide about website roots, HTTP behavior, PHP, application settings, and web-server responses. It is written for readers who may not admin… How PHP extensions affect application compatibilityHow PHP extensions affect application compatibility is a practical Spark Rack customer guide about website roots, HTTP behavior, PHP, application settings, and web-server responses. It is written for readers who may not…