Hi together,
I`ve set up a reverse proxy on my Qnap Nas to access Home Assistant over internet. The https traffic on 443 is passed to local http://192.168.5.14:8123. Only port 443 is forwarded to the Nas.
Qnap DDNS service is used / SSL certificate is also available.
With this setup I can access the Home Assistant login page using my domain https://xxx.myqnapcloud.com. However, after entering Username/Password and 2FA information it says “Unable to connect to Home Assistant” Retry.
In the Home Assistant log file following occurs:
WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from external IP. (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36)
The following configuration is used: The most important is the http: section with use_x_forwarded_for for reverse proxy. But what else has to be configured?
Just to try out I added my external ip to the auth_providers trusted networks but the same situation after entering 2fa no access.
homeassistant:
name: Home
latitude: xx.7491
longitude: x.2406
unit_system: metric
currency: EUR
time_zone: Europe/xxx
external_url: https://xxx.myqnapcloud.com
internal_url: http://192.168.5.14:8123
auth_providers:
- type: trusted_networks
trusted_networks:
- 192.168.5.0/24
- 127.0.0.1
- ::1
- type: homeassistant
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- 192.168.5.0/24
- ::1
# ip_ban_enabled: true
# login_attempts_threshold: 5
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config: