mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Client fails to query resources behind reverse proxy path #64
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jpsullivan on GitHub (Apr 5, 2024).
The
_parse_hostmethod seems to be stripping off the end of URLs that Ollama may be proxied behind. For example, if I have a rule setup in Caddy/Nginx ro forward Ollama to http://localhost:8080/ollama, the client returns "http://localhost:8080", which causes all API requests to fail as the URL is technically invalid.@DJ4ddi commented on GitHub (Apr 11, 2024):
Quick fix: Open
_client.pyand replace the last line with:@trollkarlen commented on GitHub (May 22, 2024):
Is there a fix for this in the pipe ?
Also headers for auth and more in a proxy framework would be nice to add.
@bplunkert commented on GitHub (May 29, 2024):
@trollkarlen I've opened up #170 following the suggestion by @DJ4ddi. I've tested and can confirm this seems to resolve the issue for me.
You can test it out in
requirements.txt:@kttalley commented on GitHub (Jun 30, 2024):
I believe I'm facing this same exact issue with my Windows 10 Apache server. It'd be great to get this fix for folks running multiple services from one server/domain, or for those wanting to isolate ollama to a specific sub-domain instead of dedicating the root.