Uh oh!
There was an error while loading. Please reload this page.
feat: add OPENCODE_APP_URL for custom web app proxy - #12446
Conversation
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found two potentially related PRs:
These are contextually related to URL/proxy customization, though they may address different aspects of the feature. PR #12446 specifically focuses on proxying the web UI to a custom URL via an environment variable, which appears to be a more specific use case than the broader proxy support in #10856. |
Uh oh!
There was an error while loading. Please reload this page.
f296208 to
98db1c2Comparejobrk
commented
Mar 5, 2026
@kikuchan hey this has been up for a while, could I help with anything to get this merged ? |
kikuchan
commented
Mar 6, 2026
360d5c9 to
6688e5eComparekikuchan
commented
Mar 13, 2026
The subpath doesn't work for me yet... Could you change it like this please?: diff --git a/packages/opencode/src/server/server.ts b/packages/opencode/src/server/server.ts
index ad8b0efa5..9cf0cfeda 100644
--- a/packages/opencode/src/server/server.ts+++ b/packages/opencode/src/server/server.ts@@ -559,7 +559,8 @@ export namespace Server {
// Proxy to configured app URL or default to app.opencode.ai
const appUrl = Flag.OPENCODE_APP_URL ? new URL(Flag.OPENCODE_APP_URL) : new URL("https://app.opencode.ai")
- const response = await proxy(`${appUrl.origin}${path}`, {+ appUrl.pathname = appUrl.pathname.replace(/\/$/, '') + path;+ const response = await proxy(appUrl, {
...c.req,
headers: {
...c.req.raw.headers,because |
Add environment variable to proxy the web UI to a custom URL instead of app.opencode.ai. This enables enterprises to host the web UI internally and have users run the local server pointing to the internal instance.
6688e5e to
59aab1dComparejobrk
commented
Mar 26, 2026
issue is irrelevant now |

Add environment variable to proxy the web UI to a custom URL instead of app.opencode.ai. This enables enterprises to host the web UI internally and have users run the local server pointing to the internal instance.
The code changes are simple and self explanatory
OPENCODE_APP_URLoverrides the defaulthttps://app.opencode.aibase for the web UI proxyhttps://user.github.io/opencode) works correctlyFixes#12445