openclaw - 💡(How to fix) Fix [Feature/Bug]: Local Ollama embeddings fail when proxy is enabled (SSRF defenses ignore NO_PROXY)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

OpenClaw's internal proxy system enforces SSRF protections by clearing bypass variables, making it impossible to natively exempt local embedding providers (like Ollama on 127.0.0.1) from being routed into an active HTTP proxy tunnel.

Error Message

When proxy.enabled is set to true, OpenClaw forces all traffic through the defined proxy. Local loopback traffic intended for Ollama (127.0.0.1:11434) is sent into the external proxy container (e.g., Gluetun). Because the proxy container cannot resolve the host machine's localhost, the connection fails with a 503 HTTP Tunneling error. The system aggressively strips standard environment variables like NO_PROXY and GLOBAL_AGENT_NO_PROXY to prevent SSRF vulnerabilities. Furthermore, attempting to define a bypass array directly in openclaw.json triggers a schema validation error (Unrecognized key: "bypass"). This leaves users with no native configuration path to whitelist local interfaces. Embeddings error: fetch failed | Request was cancelled. | Proxy response (503) !== 200 when HTTP Tunneling Gateway failed to start: Error: Invalid config at /home/ubuntu/.openclaw/openclaw.json.

Root Cause

When proxy.enabled is set to true, OpenClaw forces all traffic through the defined proxy. Local loopback traffic intended for Ollama (127.0.0.1:11434) is sent into the external proxy container (e.g., Gluetun). Because the proxy container cannot resolve the host machine's localhost, the connection fails with a 503 HTTP Tunneling error.

RAW_BUFFERClick to expand / collapse

Summary

OpenClaw's internal proxy system enforces SSRF protections by clearing bypass variables, making it impossible to natively exempt local embedding providers (like Ollama on 127.0.0.1) from being routed into an active HTTP proxy tunnel.

Problem to solve

When proxy.enabled is set to true, OpenClaw forces all traffic through the defined proxy. Local loopback traffic intended for Ollama (127.0.0.1:11434) is sent into the external proxy container (e.g., Gluetun). Because the proxy container cannot resolve the host machine's localhost, the connection fails with a 503 HTTP Tunneling error.

The system aggressively strips standard environment variables like NO_PROXY and GLOBAL_AGENT_NO_PROXY to prevent SSRF vulnerabilities. Furthermore, attempting to define a bypass array directly in openclaw.json triggers a schema validation error (Unrecognized key: "bypass"). This leaves users with no native configuration path to whitelist local interfaces.

Proposed solution

Introduce a dedicated, secure whitelist mechanism within openclaw.json (e.g., proxy.bypassList or a specific proxy.allowLocal boolean) that safely exempts standard loopback interfaces (127.0.0.1, localhost, ::1) from the proxy routing rules without fully disabling SSRF protections for external IP ranges.

Alternatives considered

Currently, the only way to bypass this limitation is highly convoluted:

Re-binding the host's Ollama service to listen on a Docker bridge network IP (e.g., 172.19.0.1).

Creating an artificial custom provider in the OpenClaw configuration pointing to that bridge IP.

Re-pointing the memorySearch system to use the mock provider instead of the native Ollama integration. Alternatively, users must abandon OpenClaw's native proxy settings entirely and build OS-level iptables/nftables rules to isolate the routing.

Impact

This routing flaw breaks the core experience for users operating self-hosted, privacy-focused deployments on headless servers or isolated infrastructure where routing outbound traffic through a VPN/Proxy is mandatory, but local LLMs should remain on the loopback interface.

Evidence/examples

Log output showing the proxy tunnel failure for local embeddings:

[memory] embeddings rate limited; retrying in 574ms Embeddings error: fetch failed | Request was cancelled. | Proxy response (503) !== 200 when HTTP Tunneling Log output showing the schema rejection when attempting to configure a bypass:

Gateway failed to start: Error: Invalid config at /home/ubuntu/.openclaw/openclaw.json. proxy: Unrecognized key: "bypass" Run "openclaw doctor --fix" to repair, then retry.

Additional information

OpenClaw Version: v2026.5.6 (npm managed)

OS: Ubuntu 24.04 ARM64 (Oracle OCI)

Provider: Local Ollama (qwen3-embedding:0.6b)

Proxy Setup: Gluetun HTTP proxy bound to 127.0.0.1:8888

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature/Bug]: Local Ollama embeddings fail when proxy is enabled (SSRF defenses ignore NO_PROXY)