Skip to content

Commit e044db8

Browse files
Add proxy_path config for subfolder usage in Horizon's Vue front-end (#1538)
* scale workers from min instead of max on startup * start supervisor with balanced worker count instead of min * Add proxy_path variable for reverse proxy support - Introduced `proxy_path` variable in Horizon configuration * Update horizon.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 7147a39 commit e044db8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

resources/js/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ const app = createApp({
3333

3434
app.config.globalProperties.$http = axios.create();
3535

36-
window.Horizon.basePath = '/' + window.Horizon.path;
36+
let proxyPath = window.Horizon.proxy_path;
37+
window.Horizon.basePath = proxyPath + '/' + window.Horizon.path;
3738

3839
let routerBasePath = window.Horizon.basePath + '/';
3940

4041
if (window.Horizon.path === '' || window.Horizon.path === '/') {
41-
routerBasePath = '/';
42-
window.Horizon.basePath = '';
42+
routerBasePath = proxyPath + '/';
43+
window.Horizon.basePath = proxyPath;
4344
}
4445

4546
const router = createRouter({

src/Horizon.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public static function scriptVariables()
181181
{
182182
return [
183183
'path' => config('horizon.path'),
184+
'proxy_path' => config('horizon.proxy_path', ''),
184185
];
185186
}
186187

0 commit comments

Comments
 (0)