Heroku / Render · HTTP 502

Render 502: Web Service Not Responding

Investigate Render 502 responses by checking deploy and runtime logs, the configured start command, port binding, and service health-check path.

Origin / Network Firewall

Decode a CDN or gateway error

Paste a captured HTTP response or enter a status and headers. Only the status and response headers are sent; common credential headers are filtered first.

Supports raw headers, full HTTP responses, JSON with status/statusCode and headers, cURL -v/-i response output, and HAR exports. HAR selects a server error first. cURL commands are never executed; request headers, response bodies, and common credential headers are excluded.

Diagnostic report

Error code / name

RENDER-502-BAD_GATEWAY

Fault domain

Origin / Network Firewall

Why it happened

The platform could not obtain a valid response from the web service. A failed deploy, process restart, incorrect port binding, or startup failure can leave the proxy without a healthy application.

Actionable fixes

  1. Inspect deploy and runtime logs for the first startup error and confirm the service stays running.
  2. Bind the application to the platform-provided PORT on the expected interface.
  3. Set a health-check path that returns success only after the web process is ready to serve requests.

Why this error happened

The platform could not obtain a valid response from the web service. A failed deploy, process restart, incorrect port binding, or startup failure can leave the proxy without a healthy application.

Actionable fixes

  1. Inspect deploy and runtime logs for the first startup error and confirm the service stays running.
  2. Bind the application to the platform-provided PORT on the expected interface.
  3. Set a health-check path that returns success only after the web process is ready to serve requests.

Network failure point

Client -> Render Proxy -> service process starts or binds wrong port -> no upstream response -> X

Verify origin directly via CLI

curl -sS -I -v --max-time 20 https://example.onrender.com/health

Configuration fix

render.yamlyaml
services:
  - type: web
    name: api
    runtime: node
    buildCommand: npm ci && npm run build
    startCommand: npm start
    healthCheckPath: /health/ready

Catch this failure before it becomes an outage

SteadyNode's external checks detect public 502 responses independently of deploy health panels and show whether the service recovered after a restart or release.

No credit card required.

Start for free

Frequently asked questions

Can binding to the wrong port cause a Render 502?

Yes. The service must listen on the platform-provided port and remain running for the proxy to reach it.

What should a service health-check path return?

Return a successful status when the process is ready to serve. Do not report ready before required initialization finishes.

Cloudflare

Vercel and Netlify

AWS CloudFront and ALB

Fastly

Heroku and Render

Nginx and Envoy