- Fixed port redirection for URL behind proxy

This commit is contained in:
mcndave committed 2023-04-28 19:57:52 +00:00
1 parent 2fe97c60ed
commit f9c955a82a
2 files changed
+15 -13

No files matched your search

+6 -1
View File
@@ -195,7 +195,12 @@ PATTERN;
protected function domain() : string
{
$port = $this->isDefaultPort() ? "" : ":" . $_SERVER['SERVER_PORT'];
if ( ! empty($_SERVER['HTTP_X_FORWARDED_PROTO']) || ! empty($_SERVER['HTTP_X_FORWARDED_SSL']) ) {
$port = "";
}
else {
$port = $this->isDefaultPort() ? "" : ":" . $_SERVER['SERVER_PORT'];
}
return strtolower($this->appUrl ? $this->appUrl . $port : $_SERVER['HTTP_HOST']);
}