Opencode web change /sub-dir/ in url location? #9463

Open
opened 2026-02-16 18:12:30 -05:00 by yindo · 1 comment
Owner

Originally created by @onixau-go on GitHub (Feb 16, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Question

To securely use the web version, it makes sense to use HTTPS through nginx.
This is already implemented and works.

server {
    listen 443 ssl;
    server_name ipv4;

    ssl_certificate /cert/ip/fullchain.pem;
    ssl_certificate_key /cert/ip/privkey.pem;

    location /sub-dir/ {
        proxy_pass http://localhost:port/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

But you can't change the access subdirectory.
Errors occur when logging in. The JavaScript loaded by the web version must be placed in the root of the domain. API requests are sent to the wrong URL. The server becomes unavailable.

Originally created by @onixau-go on GitHub (Feb 16, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Question To securely use the web version, it makes sense to use HTTPS through nginx. This is already implemented and works. ``` server { listen 443 ssl; server_name ipv4; ssl_certificate /cert/ip/fullchain.pem; ssl_certificate_key /cert/ip/privkey.pem; location /sub-dir/ { proxy_pass http://localhost:port/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ``` But you can't change the access subdirectory. Errors occur when logging in. The JavaScript loaded by the web version must be placed in the root of the domain. API requests are sent to the wrong URL. The server becomes unavailable.
yindo added the web label 2026-02-16 18:12:30 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 16, 2026):

This issue might be related to existing feature requests about web proxy configuration:

  • #12662: HTTPS Support for opencode web - also discusses nginx proxy workarounds
  • #12445: Support for custom web app proxy URL in firewalled environments - discusses proxy configuration needs

These issues share similar concerns about running OpenCode web behind proxies with custom configurations. You may want to review them for context on ongoing work in this area.

@github-actions[bot] commented on GitHub (Feb 16, 2026): This issue might be related to existing feature requests about web proxy configuration: - #12662: HTTPS Support for opencode web - also discusses nginx proxy workarounds - #12445: Support for custom web app proxy URL in firewalled environments - discusses proxy configuration needs These issues share similar concerns about running OpenCode web behind proxies with custom configurations. You may want to review them for context on ongoing work in this area.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9463