Skip to content

Home Assistant

nginx config

Stolen here:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen 80;

    server_name ha.example.com;
    root /srv/ha;

    access_log /srv/log/ha-access.log;
    error_log /srv/log/ha-error.log;

    location / {
        proxy_pass http://127.0.0.1:8123;
        proxy_set_header Host $host;
        # proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        # proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

# vim:set ft=nginx ai et ts=4 sts=4 sw=4 cc=80:EOF #

Home Assistant Configs

http.yaml (http: !include http.yaml)

1
2
3
4
5
6
7
8
9
# https://www.home-assistant.io/integrations/http/
use_x_forwarded_for: true
ip_ban_enabled: true
login_attempts_threshold: 5
trusted_proxies:
  - 127.0.0.1
  - ::1
  - 192.168.1.1
# vim:set ft=yaml ai et ts=2 sts=2 sw=2:EOF #

notify.yaml (notify: !include notify.yaml)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# https://www.home-assistant.io/integrations/notify
# https://www.home-assistant.io/docs/configuration/secrets/
- name: mail
  platform: smtp
  server: smtp.mail.net
  port: 587
  timeout: 15
  sender: my-ha-location@example.com
  encryption: starttls
  username: my-ha-location@example.com
  password: !secret mail_password
  sender_name: Location Home Assistant
  recipient:
    - me@example.com
# vim:set ft=yaml ai et ts=2 sts=2 sw=2:EOF #