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

Nginx proxy base url #2255

Open
2 tasks done
miuratv opened this issue Dec 26, 2022 · 2 comments
Open
2 tasks done

Nginx proxy base url #2255

miuratv opened this issue Dec 26, 2022 · 2 comments
Labels
area/gui GUI / Webapp related Enhancement New feature or request Help Wanted Extra attention is needed Solution needed Needs a solution on how to solve it
Milestone

Comments

@miuratv
Copy link

miuratv commented Dec 26, 2022

Is this a feature relevant to companion itself, and not a module?

  • I believe this to be a feature for companion, not a module

Is there an existing issue for this?

  • I have searched the existing issues

Describe the feature

I'm trying to put a companion running via docker under a nginx reverse proxy: the setup would work fine, but every link is broken because it refers to "/" url and not "/companion/".

I tried some nginx rewrite url to no avail, and i think it would be a nice security feature in general to avoid random access to obvious 8000 port.

Usecases

if a nginx reverse proxy tries to open the url "http://ipaddress/companion/" instead of the usual "http://ipaddress:8000" the page loads blank as every resource still points to "http://ipaddress/".

Manually editing the url points to the resource.

@Julusian Julusian added area/gui GUI / Webapp related Solution needed Needs a solution on how to solve it Enhancement New feature or request labels Dec 27, 2022
@Julusian
Copy link
Member

It looks like it is possible to configure vite to support this vitejs/vite#8450, any custom urls we expose will probably need manually changing to use the same prefix function.

The challenge here will be figuring out where this path/prefix should be defined, and how to propogate that into the ui when the page loads

@Julusian Julusian added the Help Wanted Extra attention is needed label Aug 30, 2023
@Julusian Julusian added this to the v3.2 milestone Sep 19, 2023
@Julusian Julusian modified the milestones: v3.2, v3.3 Jan 7, 2024
@Julusian Julusian modified the milestones: v3.3, v3.4 May 16, 2024
@Julusian
Copy link
Member

Maybe part of the solution here is to make the express server do some search and replace within the html file when serving it.
It could either adjust the paths to be relative to the root, or listen to a header to know what the hosted path is.

The ui would need to know the prefix to know what to add when generating urls, and what to strip in the router, perhaps that same header value can be forwarded to the ui for this

@Julusian Julusian modified the milestones: v3.4, v3.5 Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gui GUI / Webapp related Enhancement New feature or request Help Wanted Extra attention is needed Solution needed Needs a solution on how to solve it
Projects
Status: No status
Development

No branches or pull requests

2 participants