Skip to content

server: Add ability to mount server at prefix #14544

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

Merged
merged 4 commits into from
Jul 8, 2025

Conversation

oluwandabira
Copy link
Contributor

This is a helpful feature in cases where the server is behind a reverse proxy mounted on a non root path.

@ExtReMLapin
Copy link
Contributor

Have you tried using something else than a prefix passed thru args ? like a dot before ?

Copy link
Collaborator

@ngxson ngxson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, most reverse proxies already support rewriting URL path, so I think this feature can be a bit redundant. Example with nginx: https://superuser.com/questions/435916/nginx-rewrite-rule-to-remove-path-node

I approve this change anyway as it's not adding to much code.

@oluwandabira
Copy link
Contributor Author

Have you tried using something else than a prefix passed thru args ? like a dot before ?

I'm not sure I understand

@oluwandabira
Copy link
Contributor Author

To be fair, most reverse proxies already support rewriting URL path, so I think this feature can be a bit redundant. Example with nginx: https://superuser.com/questions/435916/nginx-rewrite-rule-to-remove-path-node

I approve this change anyway as it's not adding to much code.

I recognize that this might be a niche and redundant feature. I just happened to be in a environment where I have access to a reverse proxy but I can't change or see the server configuration, I'm just given a path where the app will be hosted.

@ggerganov ggerganov merged commit 17a1f0d into ggml-org:master Jul 8, 2025
48 checks passed
@ExtReMLapin
Copy link
Contributor

Have you tried using something else than a prefix passed thru args ? like a dot before ?

I'm not sure I understand

I didn't met the issue you met, but I never had to hardcode paths like that in the backend/frontend.

For example at the office we have a flask server on port 8080, but apache2 mounts it on port 80 and endpoint mywebsite.com/myapp/

On the frontend, all we need to do it use the api endpoints like "./api/yolo" which automatically makes it call mywebsite.com/myapp/api/yolo

on the frontend, setting the endpoint to /api/yolo insead of ./api/yolo makes it call ``mywebsite.com/api/yolo` instead

We never ever had to hardcode paths

@oluwandabira
Copy link
Contributor Author

I see, that might have worked but then I would have needed to change the frontend and I don't know enough react to bother.

@ExtReMLapin
Copy link
Contributor

ExtReMLapin commented Jul 8, 2025

Literally a dot in front of the endpoint URL.

Literally a DOT, it's not witchcraft, no need to known react.

Even if the frontend is already compiled, go in the js, ctrl+f the endpoint in the minified JS, add a . and give a try

I still believe this PR makes no sense

gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Jul 8, 2025
* origin/master:
model : fix hunyuan moe chat template (ggml-org#14584)
model : add SmolLM3 (ggml-org#14581)
memory : fix broken batch splits for recurrent cache (ggml-org#14575)
vulkan : fix rope with partial rotation and non-cont src (ggml-org#14582)
server: Add ability to mount server at prefix (ggml-org#14544)
model : add hunyuan moe (ggml-org#14425)
vulkan: increase timeout for CI (ggml-org#14574)
cuda : fix rope with partial rotation and non-cont src (ggml-org#14580)
CUDA: add bilinear interpolation for upscale (ggml-org#14563)
musa: fix build warnings (unused variable) (ggml-org#14561)
llama : fix incorrect minicpm3 v_states shape (ggml-org#14571)
llama : remove ggml_cont where possible (ggml-org#14568)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants