This page shows you how to resolve issues with [origins](https://docs.cloud.google.com/media-cdn/docs/origins.md.txt)
when you configure them to work with Media CDN.

## Troubleshoot origin connectivity

If you are receiving HTTP 50x errors, such as HTTP 502 (Gateway Timeout) or HTTP
500 (Internal Server Error), consider the following:

- Test that the origin hostname can be resolved with [Google Public
  DNS](https://dns.google/), and that the resolved IP addresses match
  expectations. If you recently changed your DNS records, resolvers might
  still have the old address in their caches.

- If your origin *only* supports HTTP/1.1 and does not support HTTP/2,
  configure the `protocol` field on the origin to use `HTTP` or `HTTPS`
  instead of `HTTP2`. Media CDN does not fall back to HTTP/1.1
  connections unless specified.

- Check that [request logs in Cloud Logging](https://docs.cloud.google.com/media-cdn/docs/logging.md.txt)
  contain the correct origin IP address.

- Check that the origin has a valid (publicly trusted) and unexpired SSL (TLS)
  certificate.

- HTTP/2 Trailers are not supported, and requests to an origin
  server don't include the "TE" request header. Trailers included in a
  response are not cached or returned to the client.

## Troubleshooting origin failover

If an origin failover isn't behaving as expected, consider the following:

- Ensure that the appropriate host header rewrite is configured on your
  failover origin.

- Ensure that your primary origin is configured with sufficient
  `maxAttemptsTimeout`, `maxAttempts`, and `timeouts` to accommodate origin
  redirects and failovers. Origin redirects count as separate connection
  attempts against the `maxAttempts` setting.

## What's next

- Read about [origin connectivity and shielding](https://docs.cloud.google.com/media-cdn/docs/origins.md.txt)