Skip to content

Commit

Permalink
to support home-assistant ingress mode
Browse files Browse the repository at this point in the history
core.php has to be modified when the web server is running in ingress mode, for example inside homeassistant
  • Loading branch information
alexandrecuer committed Apr 13, 2024
1 parent b9d044e commit 55cccc4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ function get_application_path($manual_domain=false)
}

if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$path = dirname("$proto://" . server('HTTP_X_FORWARDED_HOST') . server('SCRIPT_NAME')) . "/";
$filepath = "$proto://" . server('HTTP_X_FORWARDED_HOST');
if (isset($_SERVER['HTTP_X_INGRESS_PATH'])) {
// web server is running in ingress mode in home assistant
$filepath .= server('HTTP_X_INGRESS_PATH');
}
$filepath .= server('SCRIPT_NAME');
$path = dirname($filepath) . "/";
} else {
$path = dirname("$proto://" . server('HTTP_HOST') . server('SCRIPT_NAME')) . "/";
}
Expand Down

0 comments on commit 55cccc4

Please sign in to comment.