You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nginx反向代理Home Assistant无法正常工作的求助

Nginx反向代理Home Assistant无法正常工作的求助

各位大佬,我遇到个棘手的问题想请教下:

我平时用https://home.lan:8123访问Home Assistant一直都很正常,但最近想换成https://home-assistant.home来访问,结果各种出问题:

  • 直接访问https://home-assistant.home的时候完全没反应,页面打不开
  • 要是用HTTP访问http://home-assistant.home,倒是能进入登录界面,但登录之后HA就直接崩了,没法正常使用

我已经做了这些配置:

  1. 把Home Assistant的外部URL设置成了https://home-assistant.home
  2. 路由器的hosts文件里添加了两条映射:
home.lan 192.168.8.67
home-assistant.home 192.168.8.67

我的Nginx配置文件内容如下:

# HOME ASSISTANT
server {

    listen 443;

    server_name home-assistant.home;

    location / {
      
      access_log /var/log/nginx/access.log;
      error_log  /var/log/nginx/error.log;

      proxy_ssl_server_name on;

      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;

      proxy_pass          https://home.lan:8123;
      proxy_read_timeout  90;

      proxy_redirect      https://home-assistant.home https://home.lan:8123;
    }
}

Nginx的错误日志开头部分是这样的:

2024/06/16 14:15:41 [notice] 1#1: using the "epoll" event method
2024/06/16 14...

有没有大佬能帮我看看哪里出问题了?谢谢!

备注:内容来源于stack exchange,提问作者jotyhista

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 11:59:41