mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 03:03:27 -06:00
[GH-ISSUE #2850] Enforcing the passthrough of the HTTP-Proxy to the Ollama API client breaks functionality #67643
Reference in New Issue
Block a user
Originally created by @PierreSchwang on GitHub (Jun 5, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/2850
Bug Report
Description
Bug Summary:
Since https://github.com/open-webui/open-webui/pull/2799 was merged (latest release) the http(s)_proxy environment variable(s) are passed through to the ollama and open api http clients as is. This breaks functionality in professional networking environments, as the proxy is required to load e.g. external websites (using
#https://google.comfor example) but will fail to proxy requests in the internal network - which is the case in our setup. Open-WebUI will try to request a local IP through that proxy and obviously fails.Steps to Reproduce:
Use a Proxy, which will proxy requests to external services but rejects internal addresses.
Expected Behavior:
It should be configurable if the proxy environment variable is passed to the http client(s)
Actual Behavior:
All environment variables are used as-is.
Environment
Open WebUI Version: v0.2.4
Ollama (if applicable): -
Operating System: -
Browser (if applicable): -
Reproduction Details
Confirmation:
Installation Method
Docker.
Additional Information
N/A
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
@tjbck commented on GitHub (Jun 5, 2024):
@mindspawn
@mindspawn commented on GitHub (Jun 5, 2024):
You can use no_proxy environment variable to bypass the proxy for specific internal hosts?
It does also support wildcards.
@PierreSchwang commented on GitHub (Jun 5, 2024):
Should be documented somewhere then. no_proxy is no standardized environment variable but seems to be supported by aiohttp at least. will try tomorrow
@mindspawn commented on GitHub (Jun 5, 2024):
http_proxy, https_proxy, ftp_proxy and no_proxy are pretty much standard on any Linux distribution and not specific to open-webui. Matter of fact even Windows supports it.
Most underlying libraries honor it e.g. requests library which is also used in open-webui. open-webui has recently been switching some of the requests module calls to aiohttp and this caused the expected Linux distribution behavior to break hence this change.
There is quite a bit of documentation on these 3 env variables e.g. wget: https://www.gnu.org/software/wget/manual/html_node/Proxies.html
Additional References:
docker container proxy (same variables): https://docs.docker.com/network/proxy/
aiohttp: https://docs.aiohttp.org/en/stable/client_advanced.html
requests: https://requests.readthedocs.io/en/latest/user/advanced/
@mindspawn commented on GitHub (Jun 5, 2024):
@tjbck please let me know your preference. If you feel this should be additionally covered in https://docs.openwebui.com/getting-started/env-configuration/ I can help write something up. Although the page seems to only cover variables defined and used by open-webui not general purpose system variables. I am ok with whatever you prefer :)
@tjbck commented on GitHub (Jun 5, 2024):
@mindspawn feel free to create a new section that covers misc env vars at the bottom!