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 a "base_url" parameter to serve() to lop off route paths sent in from proxy servers? #173

Open
bdklahn opened this issue Aug 2, 2023 · 2 comments

Comments

@bdklahn
Copy link

bdklahn commented Aug 2, 2023

Thanks for this package! It's very nice and useful!

We have a setup whereby certain routes (handled by an nginx proxy server) can lead to an ad-hoc service on cluster node routes (e.g. "<host>/node/<hostname>/<port>").
Users can, for example, get slurm allocation to run a Jupyter Lab session. But the proxy server seems to pass the entire ref url path to the listener service. Jupyter Lab has a "base_url" config parameter to deal with this.
The Pluto.jl folks were nice enough to add that to the "Pluto.run()" command.
fonsp/Pluto.jl#2225
fonsp/Pluto.jl@22be5d0

I wonder if that would be easy enough to do here?

https://github.com/tlienart/LiveServer.jl/blob/9c4f0f18d8e023293ef78915609f707d48027dc0/src/server.jl#L579-L590

@tlienart
Copy link
Collaborator

tlienart commented Aug 3, 2023

could I confirm with you that what you'd like is that pages can be served at

$localhost:$port/$base_url/$relative_url

for instance localhost:8080/your/base/url/index.html ?

@bdklahn
Copy link
Author

bdklahn commented Aug 6, 2023

could I confirm with you that what you'd like is that pages can be served at

$localhost:$port/$base_url/$relative_url

for instance localhost:8080/your/base/url/index.html ?

Thanks for responding!

I think that's right. Although I think I might need to set the $host to be "0.0.0.0", for it to serve out correctly.
But I can already do that, with the "host" argument (right?).

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

No branches or pull requests

2 participants