2025年1月19日星期日 上午10:29:31

Home Assistant Core Remote access step by step(frp+ vultr) version:20221103

2 年 前
#18899 引用
Home Assistant Core Remote access  step by step version:20221103
0
2 年 前
#18900 引用
Which part? It solves an issue where HA is being a proxy . So make sure that is your setup.

The fix has 3 steps

Check configuration->basic->log for reverse proxy error
. Note the IP address in the error message. if you don’t have it, then you have a different problem.
Edit the configuration.yaml file
http:
  use_x_forwarded_for: true
  trusted_proxies:
    - XXX.XXX.XXX.XXX # Add the IP address of the proxy server


Restart your Home Assistant server.

The problem should be resolved.

如果HA内网穿透,configuration.yaml需要加上下面内容;

同时内网穿透服务器(如ngrok、frp等)的nginx需要开启websocket支持,否则会出现外网无法访问、能访问但是无法登录等问题。

HA配置文件configuration.yaml
http:
  use_x_forwarded_for: True
  trusted_proxies:
    - 127.0.0.1/24
    - ::1/128


nginx配置参考(用frp内网穿透)
server {
     listen    80;
     server_name  *.frp.yourdomain.cn frp.yourdomain.cn;
     location / {
             proxy_redirect off;
             proxy_set_header Host $http_host;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             # 下面两行提供websocket支持,homeassistant需要
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
             proxy_pass http://127.0.0.1:8080;
     }
}

0
2 年 前
#18901 引用
1
0
2 年 前
#18902 引用
root@raspberrypi:~# sudo systemctl status frpc.service
● frpc.service - Frp Client Service
     Loaded: loaded (/etc/systemd/system/frpc.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-11-26 03:34:10 CST; 1 day 4h ago
   Main PID: 426 (frpc)
      Tasks: 7 (limit: 2200)
     Memory: 16.0M
        CPU: 2min 10.539s
     CGroup: /system.slice/frpc.service
             └─426 /usr/local/frp/frpc -c /usr/local/frp/frpc.ini
0
2 年 前
#18903 引用
/usr/local/frp/frpc.ini

Add domain



[web_ha20221103.mslyt.cn]
type = http
local_ip = 127.0.0.1
local_port = 38123
use_encryption = false
use_compression = false
custom_domains = ha20221103.msly.cn

0
2 年 前
#18904 引用
Step 1:r HTTP integration is set-up for reverse proxies

https://www.home-assistant.io/integrations/http





Logger: homeassistant.components.http.forwarded
Source: components/http/forwarded.py:114
Integration: HTTP (documentation, issues)
First occurred: 08:54:28 (67 occurrences)
Last logged: 09:15:02

A request from a reverse proxy was received from 127.0.0.1, but your HTTP integration is not set-up for reverse proxies




s

0
2 个月 前
#47708 引用
ha.msly.cn 已拒绝连接 - 201410

check  configuration.yaml file  ok
check frpc login ok
check https ok
check nginx - error

repair nginx

run ok

frpc -> frps  on vps

visit
webclient -> nginx on vps -> frps on vps <--> frpc on rpi
0