Before I upgraded to the new 8.x Home Assistant version everything was working fine but now I cant seem to configure my nginx reverse proxy conf file correctly.
I started with a fresh Home Assistant install on a VM current version I’m running: Home Assistant 2022.7.7 Supervisor 2022.07.0 OS version 8.4. I have a Cloudflare domain pointing to my home IP > Pfsense firewall port forwarding to my nginx reverse proxy. nginx conf file as follows:
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name domain.com www.domain.com;
ssl_certificate /etc/ssl/certs/domain.pem;
ssl_certificate_key /etc/ssl/private/domain.pem;
ssl_client_certificate /etc/ssl/certs/cloudflareoriginfile.pem;
ssl_verify_client on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://192.168.1.100:8123;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Home assistant configuration yaml for http:
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.16.0.0/12
- 173.245.48.0/20
- 103.21.244.0/22
- 103.22.200.0/22
- 103.31.4.0/22
- 141.101.64.0/18
- 108.162.192.0/18
- 190.93.240.0/20
- 188.114.96.0/20
- 197.234.240.0/22
- 198.41.128.0/17
- 162.158.0.0/15
- 104.16.0.0/13
- 104.24.0.0/14
- 172.64.0.0/13
- 131.0.72.0/22
- 192.168.1.200 (Nginx VM)
- 127.0.0.1
ip_ban_enabled: true
login_attempts_threshold: 5
What am I missing? I’ve tried removing from HA yaml: the cloudflare proxies, removing entire http config.
Nginx conf file: tried removing lines below “location”
I can go on and on about what I’ve tried adding and/or removing without any luck?
Just to add, nginx works great for another server/backend client I’m running I just cant get it to work for HA. Please help I feel defeated.