Skip to content

[Bug / Feature Request] Support secure custom domains and reverse proxies in Unsloth Desktop #17420

Closed

Description

@Mknoops

Summary

Unsloth Desktop returns 404 Not Found when the web GUI receives an X-Forwarded-Host header containing an external hostname, even with a valid loopback Host. This prevents using the GUI behind a custom-domain Cloudflare Named Tunnel after successful Cloudflare Access authentication.

Environment

  • Unsloth Desktop on Windows
  • AMD Radeon RX 9060 XT 16 GB
  • Local URL: http://127.0.0.1:8888/
  • Reverse proxy: Cloudflare Named Tunnel with HTTPS public hostname and Cloudflare Access

Reproduction

With Unsloth Desktop running locally, execute the following from PowerShell:

# Baseline
curl.exe -sS -o NUL -w "Status: %{http_code}\n" http://127.0.0.1:8888/

# External Host
curl.exe -sS -o NUL -w "Status: %{http_code}\n" -H "Host: studio.example.com" http://127.0.0.1:8888/

# Forwarded hostname alone
curl.exe -sS -o NUL -w "Status: %{http_code}\n" -H "X-Forwarded-Host: studio.example.com" http://127.0.0.1:8888/

# Forwarded scheme alone
curl.exe -sS -o NUL -w "Status: %{http_code}\n" -H "X-Forwarded-Proto: https" http://127.0.0.1:8888/

# Both
curl.exe -sS -o NUL -w "Status: %{http_code}\n" -H "X-Forwarded-Host: studio.example.com" -H "X-Forwarded-Proto: https" http://127.0.0.1:8888/

Actual results

Request HTTP status
Local baseline 200
External Host 404
X-Forwarded-Host only 404
X-Forwarded-Proto only 200
Both forwarded headers 404

The 404 is returned with server: unsloth-studio and an empty response body.

With Cloudflare Access, login using a passkey succeeds, but the subsequent request to the public hostname returns 404. Changing the tunnel origin URL to http://127.0.0.1:8888 and overriding the HTTP Host header to 127.0.0.1:8888 did not resolve the 404.

Expected behavior / request

Please document or provide a secure, explicit opt-in way to access the authenticated desktop GUI through a user-managed reverse proxy (such as a Cloudflare Named Tunnel with a custom domain). For example, an allowlist of trusted public hostnames/proxies or guidance for routing to an appropriate authenticated remote listener.

I understand that loopback-only GUI restrictions can be intentional security protections; this report is not requesting that these protections be removed by default.

Activity

  1. changed the title [-][Bug] Unsloth Desktop GUI returns 404 behind custom Cloudflare Tunnel with X-Forwarded-Host[/-] [+][Bug / Feature Request] Support secure custom domains and reverse proxies in Unsloth Desktop[/+] on Nov 10, 2026
  2. debojyoti-dev commented on Nov 10, 2026

    @debojyoti-dev
    Contributor

    I'd like to work on this. I reproduced it: the desktop backend serves its web UI only to its own Cloudflare quick tunnel, the LAN listener, or a direct loopback browser, so a request relayed by your own proxy gets the empty 404. I plan to add an explicit opt-in, an allowlist of public hostnames (for example UNSLOTH_STUDIO_PROXY_HOSTS=studio.example.com), admitted only on the loopback listener and only when the request's Host is loopback or allowlisted, so DNS rebinding stays blocked and the default is unchanged. cc @danielhanchen

  3. added a commit that references this issue on Nov 10, 2026
    185f8ee
  4. danielhanchen commented on Nov 11, 2026

    @danielhanchen
    Member

    Fixed! Unsloth Desktop only served its web UI to its own tunnel, the LAN listener or a direct local browser, so a proxy you run yourself got an empty 404. Fixed in #17435: list your public hostnames in UNSLOTH_STUDIO_PROXY_HOSTS (on Windows setx UNSLOTH_STUDIO_PROXY_HOSTS studio.example.com, then quit and reopen Desktop), keep cloudflared's default Host header (no HTTP Host Header override), and sign in with the password from Settings > Remote access > Remote password.
    To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.

  5. added a commit that references this issue on Nov 11, 2026
    cc655b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions