I’m hoping someone can help, i have tried searching before asking.
I’m running Nginx Proxy Manager for reverse proxy (I have web sockets enabled).
I can access my HA from my pc through my reverse proxy no problem, when I try to log in with my mobile devices (Browser or HA app) it gives an error (logs show no errors at all) if I refresh the page HA registers as a failed login attempt in the error logs.
Are you using Nginx add-on for reverse proxy? If yes, then you will need to add the proxy IP address in the HTTP configuration (it is a breaking changes introduced in 2021.7)-
http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.1.70
- 192.168.1.0/24
- 172.30.33.0/24 # Add the IP address of the proxy server
cors_allowed_origins:
- reverse proxy address
See here for more information regarding reverse proxy-
Bumping this topic again. I still can’t for the life of me work out why NGINX and duckdns can be working perfectly fine from a PC instance, but when I use 4G and try to access the exact same URL, I get no response.
Is there are trusted proxy I need to add? What could I try. What is different about a phone/4G connection that would mean a refused connected here?
Interestingly, if I connect to a VPN and try to connect to the duckdns URL, I get denied as well with “Unable to fetch auth providers. https://[myduckdnsname].duckdns.org/?auth_callback=1”.
Why would I only be able to access the duckdns domain successfully from within my home network? So confused…
Sounds like the problem in some cases might be with how the proxy handles mobile traffic. One thing you could try is ensuring that your proxy configuration includes all potential IP ranges your mobile devices might use.
In my experience, adding the IP addresses for your proxy and mobile networks can sometimes help. You might also want to check out this proxy server guide for more detailed information on setting up and troubleshooting proxies. It covers a lot of useful tips that could help resolve your issue.
Thanks. I still haven’t been able to solve this problem. When you say add the mobile proxy do you mean add my mobiles IP to the trusted proxies in http section of configuration.yaml?
Not sure whether this is root cause of my problem given the same error when I use a VPN.
oh wow, big development. I think I have solved my own problem FINALLY and am ecstatic about it because I had tried EVERYTHING and was at my wits end. So my solution (in case this is useful to anyone else)… is that it was due to a sinister REOLINK doorbell that was in my network.
Basically turning off UPnP on my Reolink device has resolved the issue, and now my external access is correctly reaching my Home Assistant instance.
Root Cause:
The Reolink device was using UPnP to automatically create port forwarding rules, which were conflicting with my manually set port forwarding for Home Assistant.
Resolution:
Disabling UPnP on the Reolink device stopped it from interfering with your network’s routing and port forwarding.
Current Status:
My external access is now correctly reaching my Home Assistant instance, as intended.
I have tested this so far on my 4G mobile and a VPN and both are working as intended.
I did also end up moving from the NGINX SSL add on to the NGINX Proxy Manager add-on and adding the Custom Location headers as described here: "Unable to connect to Home Assistant" via nginx reverse proxy - #48 by yousaf465
However, I think the root cause problem in the end was the UPnP on that pesky doorbell.
It should be a warning as well regarding any device on the network that uses UPnP.
Hope this helps someone.