Unable to connect to Home Assistant using external domain

Hello,

I have some issues working with SSL configuration…

I have a domain which points to my public IP address.

Then in my router I forward all incoming 80 and 443 port requests to my rpi which runs nginx.

Nginx is redirecting based on the server name (URL with sub domains etc) towards my local IP address of homeassistant, which is http (http://localipofha:8123). All http calls will be redirected to https.

When I go to the local IP address of HA, I can login and use like normal, but when I use my external domain or external IP address, I can login but as soon as I’m logged in I’m getting the ‘Unable to connect to Home Assistant’.

Anyone got some tips where to look?

PS: where could I find all network related logs from HA?

Thanks in advance!

Did you configure trusted_proxies ?

I have no knowledge about trusted proxies… could you elaborate this or provide some documentation?

You need something like this :

http:
  ip_ban_enabled: true
  login_attempts_threshold: 5
  cors_allowed_origins:
    - https://google.com
    - https://www.home-assistant.io
  use_x_forwarded_for: true    
  trusted_proxies:
    - 10.0.0.63
    - 10.0.0.67
    - 172.18.0.2

I’ve added the following:

http:
  ip_ban_enabled: true
  login_attempts_threshold: 5
  cors_allowed_origins:
    - https://google.com
    - https://www.home-assistant.io
  use_x_forwarded_for: true
  trusted_proxies:
    - 192.168.1.19

And it is still giving the same behaviour (Unable to connect… after login)
I suppose that I have to fill in the (local) ip address of my RPI that is running my nginx instance?

I’ve found a solution that fixed my issue: https://github.com/home-assistant/core/issues/24750#issuecomment-557427397

1 Like