A company already running nginx may wonder what changes when it adds a CDN. Both systems can accept a request on behalf of an upstream service. Their placement, failure domains and operational owners determine which work belongs at each layer.

Draw the two connections

In a common deployment, the browser connects to an edge location, then the CDN connects to the company’s reverse proxy. The proxy still routes /api and /media to their respective backends. The two connections have separate hostnames, certificate checks and logs. A healthy visitor certificate says little about the upstream one.

Assign cache policy to someone

Layered caches can disagree about which cookies select a private response or how long a price stays fresh. Give the application team authority over response meaning, then translate it into explicit edge and proxy rules. For a price correction, identify every shared layer holding the old response and which team can clear it.

Diagnose a redirect at the right hop

If HTTPS visitors keep receiving a redirect to the URL they already requested, inspect the scheme seen by the origin proxy. Establish which trusted forwarder can supply the original scheme, then compare the Location header before and after the change. Keep inbound client-supplied forwarding headers outside this trust boundary.

Sources & further reading

Reader questions

Can our existing proxy remain after a CDN rollout?

Yes. Give the CDN a stable origin hostname for that proxy and test its host routing and TLS validation independently of the public delivery hostname.