Skip to content

Commit

Permalink
Merge pull request #1878 from alexandrecuer/master
Browse files Browse the repository at this point in the history
to support home-assistant ingress mode :-)
  • Loading branch information
TrystanLea committed Apr 23, 2024
2 parents 0ce9962 + 55cccc4 commit 738f4ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core.php
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 738f4ab

Please sign in to comment.