Compare commits
2 commits
d0bfeabcfe
...
1219e3f20f
Author | SHA1 | Date | |
---|---|---|---|
1219e3f20f | |||
0af1267343 |
17
home-assistant/README.md
Normal file
17
home-assistant/README.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Home Assistant
|
||||||
|
|
||||||
|
## Using with reverse proxy (like Nginx)
|
||||||
|
|
||||||
|
If you're using Home Assistant with reverse proxy, you need to enable it and add trusted proxy address. Otherwise you
|
||||||
|
will get 400 (Bad Request) each time you try to open HA's web interface.
|
||||||
|
|
||||||
|
To achieve that edit `configuration.yaml` after it was generated at first launch and add missing options.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# config/configuration.yaml
|
||||||
|
http:
|
||||||
|
use_x_forwarded_for: true
|
||||||
|
trusted_proxies:
|
||||||
|
- '127.0.0.1'
|
||||||
|
- '::1'
|
||||||
|
```
|
24
home-assistant/nginx/home-assistant.conf
Normal file
24
home-assistant/nginx/home-assistant.conf
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name ha.domain.tld;
|
||||||
|
|
||||||
|
#charset utf-8;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
#proxy_hide_header X-Powered-By; ## Hides nginx server version from bad guys.
|
||||||
|
proxy_set_header Range $http_range; ## Allows specific chunks of a file to be requested.
|
||||||
|
proxy_set_header If-Range $http_if_range; ## Allows specific chunks of a file to be requested.
|
||||||
|
#proxy_set_header X-Real-IP $http_CF_Connecting_IP; ## if you use cloudflare un-comment this line and comment out above line.
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $http_connection;
|
||||||
|
|
||||||
|
proxy_pass http://localhost:8123/;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue