In an app that requires to work on a custom URL like https://domain.ext/base-path, Horizon Vue routes seems to be broken.
URL is defined with APP_URL in laravel and the use of the full path as root URL is done with the use of URL::forceRootUrl() in the AppServiceProvider.
When browing on Horizon page from https://domain.ext/base-path/horizon, an empty dashboard appears.
When clicking on any tab in the menu - let's take the Dashboard button - a redirection is made toward https://domain.ext/horizon/dashboard. The full URL is not taken in account.
The workload, stats and master resources are loaded from the https://domain.ext/horizon/api/workload, https://domain.ext/horizon/api/stats and https://domain.ext/horizon/api/master URLs, triggering a 404 error for each one of them.
Is there an existing way to make Horizon work in this case or is this something that is not existing yet?
Steps To Reproduce
Install a fresh Laravel Instance with Horizon, configured to be accessed from a prefixed URL like https://domain.ext/base-path.
Then, declare this custom URL in the .envAPP_URL env variable.
In addition, declare URL::forceRootUrl('https://domain.ext/base-path') in the AppServiceProviderboot method.
Laravel will now use this URL as the base URL of all generated routes, but not for Horizon JS resources.
Horizon Version
5.24.3
Laravel Version
10.48.11
PHP Version
8.3.4
Redis Driver
PhpRedis
Redis Version
Irrelevant
Database Driver & Version
Irrelevant
Description
In an app that requires to work on a custom URL like
https://domain.ext/base-path
, Horizon Vue routes seems to be broken.URL is defined with
APP_URL
in laravel and the use of the full path as root URL is done with the use ofURL::forceRootUrl()
in theAppServiceProvider
.When browing on Horizon page from
https://domain.ext/base-path/horizon
, an empty dashboard appears.When clicking on any tab in the menu - let's take the
Dashboard
button - a redirection is made towardhttps://domain.ext/horizon/dashboard
. The full URL is not taken in account.The
workload
,stats
andmaster
resources are loaded from thehttps://domain.ext/horizon/api/workload
,https://domain.ext/horizon/api/stats
andhttps://domain.ext/horizon/api/master
URLs, triggering a 404 error for each one of them.Is there an existing way to make Horizon work in this case or is this something that is not existing yet?
Steps To Reproduce
Install a fresh Laravel Instance with Horizon, configured to be accessed from a prefixed URL like
https://domain.ext/base-path
.Then, declare this custom URL in the
.env
APP_URL
env variable.In addition, declare
URL::forceRootUrl('https://domain.ext/base-path')
in theAppServiceProvider
boot
method.Laravel will now use this URL as the base URL of all generated routes, but not for Horizon JS resources.