DanielC -
Joined: 19 Jan 2008 Posts: 8 Location: France
|
Posted: Mon Mar 31, 2025 5:00 pm Post subject: HTTPS frontend for OpenWebUI (reverse proxy with websockets) |
|
|
Hi,
Has anyone managed to get OpenWebUI (v0.5.20) working through through the reverse proxy ?
I seem to either get a 500 Internal Server Error with this shown in OpenWebUI Docker Logs :
Code: | assert scope["type"] == "http"
AssertionError | Using this configuration :
Code: | Local Virtual Path: /
Remote Host: 127.0.0.1
Remote Port: 8080
Remote Virtual Path: /
HTTPS: No
Fix URLs in Cookies: Yes
Fix URLs in Location Response Headers: Yes
Preserve the "Host" Header: Yes
Upgrade: websocket
Connection: upgrade
Sec-WebSocket-Key: ************************
Sec-WebSocket-Version: 13
Timeout : 600 second(s)
Connection Timeout: 600 second(s) | Or i get a blank page (200 OK) with this shown in OpenWebUI Docker Logs :
Code: | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:0 - "GET / HTTP/1.1" 200 - {} | Using this configuration :
Code: | Local Virtual Path: /
Remote Host: 127.0.0.1
Remote Port: 8080
Remote Virtual Path: /
HTTPS: No
Fix URLs in Cookies: Yes
Fix URLs in Location Response Headers: Yes
Preserve the "Host" Header: Yes
Timeout : 600 second(s)
Connection Timeout: 600 second(s) | I have tried various combinations :
- One proxy for everything under / with upgrade
- Two proxys with one for / without upgrade and one for /ws/socket.io/ with upgrade
- Various combinations of preserve host or not
- Using X-Real-IP, X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Port or not
- Using Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers, or not
- Using the root of a subdomain or using 127.0.0.1
- Using HTTPS or using only HTTP
I was using a remote Abyss install, but I also did a fresh install directly on the host just to test, same results.
The docker instance is currently running via this command, but others have been tried, with or without socketio and cors etc. : Code: | docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 -e SOCKETIO_PATH=/ws/socket.io -e CORS_ALLOW_ORIGIN=* --name open-webui --restart always ghcr.io/open-webui/open-webui:main | I can access the OpenWebUI perfectly fine on http://127.0.0.1:8080/
OpenWebUI also works fine with an NGINX reverse proxy using just the two upgrade headers.
Am I stupidly missing or misunderstanding something incredibly simple or is there a deeper problem, maybe related to the websockets ? _________________ ~ Dan
www.danielclayton.com |
|