diff --git a/moltbot_assistant/config.yaml b/moltbot_assistant/config.yaml index 9a41f26..04c2be4 100644 --- a/moltbot_assistant/config.yaml +++ b/moltbot_assistant/config.yaml @@ -1,5 +1,5 @@ name: Moltbot Assistant -version: "0.3.7" +version: "0.3.8" slug: moltbot_assistant description: Run Moltbot Assistant (Clawdbot-compatible) as a Home Assistant add-on. url: https://github.com/techartdev/ClawdHAAddOn diff --git a/moltbot_assistant/nginx.conf.tpl b/moltbot_assistant/nginx.conf.tpl index c214925..f6cfb76 100644 --- a/moltbot_assistant/nginx.conf.tpl +++ b/moltbot_assistant/nginx.conf.tpl @@ -37,8 +37,16 @@ http { # out of ingress (to the HA host root). So we use a *relative* redirect. # Only redirect the root document to add token in the browser URL. + # NOTE: Home Assistant Ingress can expose the add-on at a path like: + # /hassio/ingress/ + # which may not end in a slash. Some clients compute relative URLs (including WS) + # incorrectly if the URL doesn't end in '/'. HA often provides the original ingress + # path via X-Ingress-Path; if present, redirect to that path with a trailing slash. location = / { if ($arg_token = "") { + if ($http_x_ingress_path != "") { + return 302 $http_x_ingress_path/?token=__GATEWAY_TOKEN__; + } return 302 ?token=__GATEWAY_TOKEN__; }