Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy_path config for subfolder usage in Horizon's Vue front-end #1538

Merged
merged 5 commits into from
Mar 4, 2025

Conversation

andre-hoffmann
Copy link
Contributor

Description

This pull request adds a new config key proxy_path to Laravel Horizon, allowing developers to serve Horizon behind a reverse proxy in a subfolder (e.g. example.com/some-prefix/horizon) without impacting existing setups that rely on the default path. This new config ensures that Horizon’s Vue front-end correctly references the subfolder path for API calls and other resources.

Key Changes:

  • Introduces a proxy_path configuration to config/horizon.php.
  • Ensures front-end calls check proxy_path so subfolder routing works properly behind a proxy.
  • Maintains backward compatibility by leaving the existing path configuration untouched if proxy_path is empty.

With this change, anyone who needs a subfolder URL behind a proxy (e.g. example.com/laravel/horizon) can specify proxy_path accordingly, avoiding the need for additional rewrites or patchwork solutions—all while preserving the default Horizon behavior for other installations.

andre-hoffmann and others added 5 commits February 26, 2025 08:37

Verified

This commit was signed with the committer’s verified signature.
jaraco Jason R. Coombs

Verified

This commit was signed with the committer’s verified signature.
jaraco Jason R. Coombs
- Introduced `proxy_path` variable in Horizon configuration

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@taylorotwell taylorotwell merged commit e044db8 into laravel:5.x Mar 4, 2025
14 checks passed
@andre-hoffmann
Copy link
Contributor Author

@taylorotwell

First of all, thank you for approving the PR!

I have a quick question—I noticed that you updated horizon.php to remove the new config variable. How would someone know that this functionality is available?

I just want to ensure that my next PR is as polished as possible.

@RikkiMasters
Copy link

Thanks, I've needed this since time began. Works great.

I agree that it needs to be in Horizon.php by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants