NGINX Proxy Manager - Too Many Redirects

I’m having an issue with Nginx, which I’m wondering if anyone else has seen.
I have 2 instances of HA setup one on an HA Blue and one on a Debian 11 server (setup correctly and compliant). I have NGinx Proxy Manager on the Debian server loaded as the HA Integration.

I have a mydomain.com domain name registered with google domains and DNS managed under cloudflare. The DNS is defined as follows;


In NPM I’ve defined and requested SSL certificates successfully for all the subdomains I require as well as the 2 HA instances mentioned above as follows;

The HA instance that is on the HA Blue calls fine, no problems, however the HA that NPM is hosted on as well as all the subdomains gives me the following error;
DNS Error
Anyone got any clues as to what I’ve got wrong?

What’s your external_url on homeassistant.blabla.com ?

https://homeassistant.xxxxxxxxxx.com

ports 80 and 443 are re-directed to the nginx host.

Maybe check the network tab of the dev tools of your browser to check why there seem to be a redirect loop…

I get essentially the error message i.e. there is an attempt to access homeassistant.xxxxxxxxxx.com multiple times. What I don’t get is why that is the case from 192.168.86.207, but does not happen from 192.168.86.210, it just resolves.

Be sure that logs are not reset at each redirect.

FF example

got preserved logs, and the following;
status code
So I’m thinking that the Status code is key here, but when i look it up its defined as " Moved Permanently", which appears to indicate that its calling itself, hence the looping, but I can’t see why that would be the case.

What’s in the Location: header?

This is where I’m getting out of my depth…, but this is the header response;

You have cloudflare in front, apparently.
This is where something is misconfigured, as it forwards on itself.

your cloudflare seems to be ok and I don’t see any problem with your setup. Maybe it got tangle up on your HASSIO setup?

That was why I included the cloudflare dns config info. My only other line of thought was that it is something I have not configured in NPM to stop it recursively calling the same location. The successful route https://hassio.xxxxxxxxxx.com is on a different IP to NPM and the unsuccessful route https://homeassistant.xxxxxxxxxx.com

I’m convinced the issue is with the NPM and nginx config.

your cloudflare seems to be ok and I don’t see any problem with your setup. Maybe it got tangle up on your HASSIO setup?

BTW please read my private messages

Ah, I missed the 1st one was cloudflare.
Well, it’s “proxied”, so check the proxy config.

I dont think the problem coming from cloudflare since its proxied internal domain only. Its have something to do with local IP setting since its effect all 3 other subdomain

I think I found the answer to my situation. I found it when reading a blog https://www.smarthomebeginner.com/traefik-2-docker-tutorial/
The tutorial is very good by the way, but one of the messages in there was that with cloudflare you need to set the domain SSL/TLS encryption mode to Full. “In addition to creating the DNS records, you will have to adjust Cloudflare’s SSL settings to avoid indefinite redirects.”.

The penny dropped and so i changed from Flexible (which I think is the default) to Full and lo and behold it stops the too many redirects situation. Hope this is useful to anyone else experiencing this situation.

10 Likes

Your solution worked for me too. Thanks for sharing.

This also did it for me too…so obscure… so many hours wasted.