Repository navigation
expose --host-header: make Ollama and other host-checking services work (0.7.1) - #11
Merged
Merged
Conversation
…angolin) Ollama, Vite and similar dev servers refuse requests whose Host isn't localhost, so exposing them returned 403 even with the right key. Cloudflare: ingress originRequest.httpHostHeader; Pangolin: setHostHeader. Tailscale serve can't rewrite Host, so the flag is refused there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
Contributor
Author
|
Correction: the description says Pangolin The test script pulled the token with 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Exposing Ollama (the README's headline example,
expose ai 11434) returned 403 even with the right key, through every provider. Ollama only answers requests whoseHostislocalhost/a loopback address; Cloudflare, Pangolin and Tailscale all forward the public host name. Vite and Rails dev servers do the same. The earlier demo used a mock model, so this went unnoticed.Change
expose ... --host-header <host>(opt-in):originRequest.httpHostHeadersetHostHeadertailscale servecan't rewrite Host)Off by default because ordinary web apps (Rails, for one) need the real host name for links and redirects. README (EN/ZH) examples and CLAUDE.md updated. VERSION 0.7.1.
Tested on the test machine (real Ollama, qwen2.5:1.5b)
--auth bearer --host-header localhost: with key 200 and the model answers (~2.8 s round trip); without key 403 at the edge--auth password --host-header localhost: with credentials 200; without 401--host-header: refused with the hintFound on the way, not fixed here: Pangolin
--auth tokenreturns 401 even with the right token, with or without--host-headerand on other ports too — a separate pre-existing issue.🤖 Generated with Claude Code