The Open WebUI system is designed to streamline interactions between the client (your browser) and the Ollama API. At the heart of this design is a backend reverse proxy, enhancing security and resolving CORS issues.
-
How it Works: The Open WebUI is designed to interact with the Ollama API through a specific route. When a request is made from the WebUI to Ollama, it is not directly sent to the Ollama API. Initially, the request is sent to the Open WebUI backend via
/ollama
route. From there, the backend is responsible for forwarding the request to the Ollama API. This forwarding is accomplished by using the route specified in theOLLAMA_BASE_URL
environment variable. Therefore, a request made to/ollama
in the WebUI is effectively the same as making a request toOLLAMA_BASE_URL
in the backend. For instance, a request to/ollama/api/tags
in the WebUI is equivalent toOLLAMA_BASE_URL/api/tags
in the backend. -
Security Benefits: This design prevents direct exposure of the Ollama API to the frontend, safeguarding against potential CORS (Cross-Origin Resource Sharing) issues and unauthorized access. Requiring authentication to access the Ollama API further enhances this security layer.
If you're experiencing connection issues, it’s often due to the WebUI docker container not being able to reach the Ollama server at 127.0.0.1:11434 (host.docker.internal:11434) i