Skip to content

fix(ollama): reject a proxy endpoint on its upstream daemon's port - #14909

Open
shaojunying wants to merge 1 commit into
NVIDIA:v1from
shaojunying:fix/ollama-proxy-own-port
Open

shaojunying wants to merge 1 commit into
NVIDIA:v1from
shaojunying:fix/ollama-proxy-own-port

Conversation

@shaojunying

Copy link
Copy Markdown

Validation now rejects an ollamaProxy service whose endpoint uses the upstream daemon's port, instead of accepting a proxy that answers every request with 502.

Problem

The proxy shares the host network and, before each request, rejects any non-loopback listener on the daemon's port.
Validation compared only the two URL strings, so endpoint: http://172.20.0.1:11434/v1 in front of upstream.endpoint: http://127.0.0.1:11434/v1 passed.
The proxy checks the daemon before it binds, so it started. After that, each request found the proxy's own 172.20.0.1:11434 listener, failed the check, and returned 502 without the reason.

Resolves #14907.

Change

  • Require the proxy endpoint's port to differ from the upstream port, with its own error message. This replaces the string comparison, which it covers.
  • Keep the proxy's listener check unchanged. Excluding the proxy's own address there would also work, but it would change a security check to support a configuration that has no use.
  • Add proxy_rejects_an_endpoint_on_the_daemon_port, which failed before the change.
  • Say in the inference guide that the proxy needs a port other than the daemon's.

Beyond CI

I did not run the proxy against a live Ollama daemon. The 502 path comes from Proxy::start, dispatch, and loopback_listener in crates/nemoclaw-ollama-proxy/src/lib.rs.

Signed-off-by: shaojunying 30252316+shaojunying@users.noreply.github.com

The proxy shares the host network and, before each request, rejects any non-loopback listener on the daemon's port. A proxy endpoint such as http://172.20.0.1:11434/v1 in front of a daemon on 127.0.0.1:11434 passed validation, started, and then answered every request with 502, because the check found the proxy's own listener.

Signed-off-by: shaojunying <30252316+shaojunying@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the v1 NemoClaw v1 branch label Nov 26, 2026
@shaojunying

Copy link
Copy Markdown
Author
Authoring session — opening
Field Status Value Evidence or limit
Harness partial Claude Code; a subagent of a Claude Code desktop session Agent context; the version is not recorded there
Skills partial nemoclaw-contributor-create-pr (complete read) Reads in this agent's context; harness skill injections not inspected
Instruction files partial CONTRIBUTING.md on main (complete read); .github/PULL_REQUEST_TEMPLATE.md (complete read); .github/SESSION_REPORT_TEMPLATE.md (complete read); AGENTS.md (first 120 lines); WRITING.md (first 80 lines) Reads in this agent's context; startup injections not inspected
Tool calls partial Bash: at least 100; Edit: 9; Write: 1; Agent: 2; Skill: 1; subagent nested calls: 109 Counted from this agent's context, including failed calls; the Bash wrapper hides nested commands
Tokens unavailable - The session JSONL usage counters were not read
Session window partial 2026-11-26T16:55Z to 2026-11-26T17:35Z; about 40 min Repository clone time to this report; earlier session activity not inspected
Compactions partial 0 None visible in this agent's context; the session record was not inspected
Models partial claude-opus-5-5 Agent environment metadata; no model changes visible
Reasoning levels unavailable - Reasoning-level metadata not visible to the agent

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant