Too many redirects: worker fetch using http instead of https

For Workers & Pages, what is the name of the domain?

auth.sane.fyi

What is the error message?

TypeError: Too many redirects.

What is the issue or error you’re encountering

Workers request to fetch external AWS ALB keeps redirecting from HTTP:80 to HTTPS:443 but never resolvers the HTTPS:443 interface

What steps have you taken to resolve the issue?

I’ve tried setting different Headers on the request to enforce HTTPS connection like setting the Host header, using cf.resolveOverride etc. but it still results in the same issue where the initial request responds back with a 301 moved permanently with location “https://api.sane.fyi:443/v1/internal/get-user”. The original request was to “https://api.sane.fyi/v1/internal/get-user”.

Here’s an example cf-ray id: 90fc02e2f46ff0ec-CDG

It turns out to be because of the SSL/TLS Configuration was set to Flexible which would always communicate with the origin server over HTTP. Changing this to full fixed the issue.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.