[PR #1701] [CLOSED] (feat) allow deployment under relative base path #59610

Closed
opened 2026-05-06 01:46:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/1701
Author: @behackl
Created: 4/23/2024
Status: Closed

Base: devHead: feat-relative-base-path


📝 Commits (3)

  • faa6415 respect set base path within frontend
  • 8203a50 respect WEBUI_BASE_PATH in manifest.json
  • 3510e8d add build arg WEBUI_BASE_PATH to dockerfile

📊 Changes

24 files changed (+88 additions, -60 deletions)

View changed files

📝 Dockerfile (+4 -1)
📝 backend/config.py (+1 -0)
📝 backend/main.py (+3 -2)
📝 src/lib/components/chat/Settings/Chats.svelte (+3 -2)
📝 src/lib/components/chat/ShareChatModal.svelte (+3 -2)
📝 src/lib/components/layout/Sidebar.svelte (+12 -11)
📝 src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte (+2 -1)
📝 src/lib/constants.ts (+2 -1)
📝 src/routes/(app)/+layout.svelte (+4 -3)
📝 src/routes/(app)/+page.svelte (+4 -3)
📝 src/routes/(app)/admin/+page.svelte (+2 -1)
📝 src/routes/(app)/c/[id]/+page.svelte (+7 -6)
📝 src/routes/(app)/modelfiles/+page.svelte (+5 -4)
📝 src/routes/(app)/modelfiles/create/+page.svelte (+2 -1)
📝 src/routes/(app)/modelfiles/edit/+page.svelte (+3 -2)
📝 src/routes/(app)/playground/+page.svelte (+2 -1)
📝 src/routes/(app)/prompts/+page.svelte (+5 -4)
📝 src/routes/(app)/prompts/create/+page.svelte (+2 -1)
📝 src/routes/(app)/prompts/edit/+page.svelte (+4 -3)
📝 src/routes/+layout.svelte (+5 -4)

...and 4 more files

📄 Description

Pull Request Checklist

  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?

Description

This introduces some changes mainly to the frontend (plus the construction of manifest.json in the backend) that allows setting a relative base path via the environment variable (or, in the context of the docker build process, the build argument) WEBUI_BASE_PATH.

Please note: I am not familiar with svelte at all, and it feels like there might be a much simpler solution than what I did here -- however, I've used this branch to deploy a working instance behind a standard reverse proxy configuration (in this case Apache):

ProxyPreserveHost On
ProxyPass /chat http://example.com:8077
ProxyPassReverse /chat http://example.com:8077

such that the interface is available at https://original.example.com/chat.

Related to #1162.

Unfortunately I won't have time to put much more effort towards this, maybe this can be useful to whoever comes up with a proper implementation of this feature eventually. :-)


Changelog Entry

Added

  • Docker build argument WEBUI_BASE_PATH which controls the relative base path used in the built frontend (plus in manifest.json).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/1701 **Author:** [@behackl](https://github.com/behackl) **Created:** 4/23/2024 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat-relative-base-path` --- ### 📝 Commits (3) - [`faa6415`](https://github.com/open-webui/open-webui/commit/faa6415d55f7fee8bf997c6cd2088b494093a789) respect set base path within frontend - [`8203a50`](https://github.com/open-webui/open-webui/commit/8203a5060842fcaa177f2f951d844cc10fc67dc7) respect WEBUI_BASE_PATH in manifest.json - [`3510e8d`](https://github.com/open-webui/open-webui/commit/3510e8dfd517ed1b83dd6cba358b56c4e4d18568) add build arg WEBUI_BASE_PATH to dockerfile ### 📊 Changes **24 files changed** (+88 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+4 -1) 📝 `backend/config.py` (+1 -0) 📝 `backend/main.py` (+3 -2) 📝 `src/lib/components/chat/Settings/Chats.svelte` (+3 -2) 📝 `src/lib/components/chat/ShareChatModal.svelte` (+3 -2) 📝 `src/lib/components/layout/Sidebar.svelte` (+12 -11) 📝 `src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte` (+2 -1) 📝 `src/lib/constants.ts` (+2 -1) 📝 `src/routes/(app)/+layout.svelte` (+4 -3) 📝 `src/routes/(app)/+page.svelte` (+4 -3) 📝 `src/routes/(app)/admin/+page.svelte` (+2 -1) 📝 `src/routes/(app)/c/[id]/+page.svelte` (+7 -6) 📝 `src/routes/(app)/modelfiles/+page.svelte` (+5 -4) 📝 `src/routes/(app)/modelfiles/create/+page.svelte` (+2 -1) 📝 `src/routes/(app)/modelfiles/edit/+page.svelte` (+3 -2) 📝 `src/routes/(app)/playground/+page.svelte` (+2 -1) 📝 `src/routes/(app)/prompts/+page.svelte` (+5 -4) 📝 `src/routes/(app)/prompts/create/+page.svelte` (+2 -1) 📝 `src/routes/(app)/prompts/edit/+page.svelte` (+4 -3) 📝 `src/routes/+layout.svelte` (+5 -4) _...and 4 more files_ </details> ### 📄 Description ## Pull Request Checklist - [x] **Description:** Briefly describe the changes in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? --- ## Description This introduces some changes mainly to the frontend (plus the construction of `manifest.json` in the backend) that allows setting a relative base path via the environment variable (or, in the context of the docker build process, the build argument) `WEBUI_BASE_PATH`. Please note: I am not familiar with svelte at all, and it feels like there might be a much simpler solution than what I did here -- however, I've used this branch to deploy a working instance behind a standard reverse proxy configuration (in this case Apache): ``` ProxyPreserveHost On ProxyPass /chat http://example.com:8077 ProxyPassReverse /chat http://example.com:8077 ``` such that the interface is available at `https://original.example.com/chat`. Related to #1162. Unfortunately I won't have time to put much more effort towards this, maybe this can be useful to whoever comes up with a proper implementation of this feature eventually. :-) --- ### Changelog Entry ### Added - Docker build argument `WEBUI_BASE_PATH` which controls the relative base path used in the built frontend (plus in `manifest.json`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 01:46:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#59610