mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-31 22:08:51 -05:00
issue: Running v0.3.3 behind reverse proxy with HTTPS. CORS problems with tools and websockets #1215
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 @leuchtetgruen on GitHub (Jun 12, 2024).
I'm running OpenWebUI behind a nginx reverse proxy like so:
As of Open Web UI 0.3.3 I get CORS problems in Firefox and Safari (and presumably also other browsers):
This results in the UI not showing.
I'm running OpenWebUI in docker (
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main).In v0.3.2 I still get the errors about the websockets (the one about the /api/v1/tools is not present) but the UI is showing and working.
@Testorakel commented on GitHub (Jun 12, 2024):
I have these problems too, but I use Apache.
@KelvinCampelo commented on GitHub (Jun 12, 2024):
Hey mate,
I've had the same issue running Open WebUI under a reverse proxy with SSL. I was able to resolve it by adding the following line to the location directive in my Nginx configuration:
Explanation:
The Mixed Content error occurs when a secure HTTPS page attempts to request an insecure HTTP resource. Modern browsers block these requests to ensure security.
When Nginx acts as a reverse proxy, it terminates the SSL connection and forwards the request to the backend server (in this case, Open WebUI). The backend server needs to know the original protocol (HTTP or HTTPS) used by the client to generate URLs correctly.
By adding proxy_set_header X-Forwarded-Proto $scheme;, we inform the backend server of the original request scheme. This allows the backend server to generate URLs with the correct scheme, thus avoiding mixed content errors.
This small change ensures that all components in the application are aware of the original request's protocol, allowing them to behave correctly and securely.
Hope this helps!
@leuchtetgruen commented on GitHub (Jun 12, 2024):
Thank you, that helped!