A 'return 301 https://$host$request_uri' block inside the HTTPS server block sends HTTPS traffic back to itself, producing an infinite loop behind a TLS-terminating proxy.
A 'return 301 https://$host$request_uri' block inside the HTTPS server block sends HTTPS traffic back to itself, producing an infinite loop behind a TLS-terminating proxy.
Keep the redirect only in the port 80 server block, and behind a proxy redirect on $http_x_forwarded_proto = http rather than on the port.
Nginx has its own failure mode, but ERR_TOO_MANY_REDIRECTS has a wider set of causes. The most common one overall is: The CDN forwards to the origin over HTTP while the origin redirects all HTTP to HTTPS — an infinite loop.
Switch the CDN's SSL mode to Full so the origin leg is encrypted, or make the origin trust the forwarded-proto header instead of the raw scheme.
The uptime probe returns the full redirect chain, so you can see the exact two URLs bouncing off each other instead of inferring it from behaviour.
A 'return 301 https://$host$request_uri' block inside the HTTPS server block sends HTTPS traffic back to itself, producing an infinite loop behind a TLS-terminating proxy.
Keep the redirect only in the port 80 server block, and behind a proxy redirect on $http_x_forwarded_proto = http rather than on the port.
Two rules are bouncing the request back and forth — most often an HTTPS redirect at the application level fighting a proxy that is forwarding as plain HTTP, so each side thinks the other needs to upgrade.