homeassistant: отключен порт 8123 для внешних соединений, поправлены настройки nginx

master 82
parent 1bb12283be
commit 0d5e13fea8

@ -1,9 +1,22 @@
# Calculate path=/etc/nginx/sites-enabled exists(/etc/nginx/sites-enabled/#-cut()-#)== comment=#
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass "http://127.0.0.1:8123";
}
listen 80;
location / {
proxy_pass "http://127.0.0.1:8123";
proxy_connect_timeout 60;
proxy_http_version 1.1;
proxy_intercept_errors off;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}

@ -23,6 +23,7 @@ kill $id_hass
cat >> ~/.homeassistant/configuration.yaml <<EOF
http:
server_host: 127.0.0.1
use_x_forwarded_for: true
trusted_proxies: 127.0.0.1
EOF

Loading…
Cancel
Save