[GH-ISSUE #1546] Is running behind a proxy fully supported? #844

Closed
opened 2026-04-12 10:30:32 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @pardeike on GitHub (Dec 15, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1546

Hi,

when I run with a configured proxy, I get the error lookup registry.ollama.ai: no such host:

> HTTPS_PROXY=http://REDACTED.XXX:10000 ollama run llama2
pulling manifest 
Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp: lookup registry.ollama.ai: no such host

I then added a manual dns entry to /etc/hosts and ran the command again, but this time after trying to fetch the manifest, I get

> HTTPS_PROXY=http://REDACTED.XXX:10000 ollama run llama2
pulling manifest 
Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp 34.120.132.20:443: connect: network is unreachable

Going to those urls in Safari works just fine so it seems that the proxy support isn't fully working.

Originally created by @pardeike on GitHub (Dec 15, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1546 Hi, when I run with a configured proxy, I get the error `lookup registry.ollama.ai: no such host`: ``` > HTTPS_PROXY=http://REDACTED.XXX:10000 ollama run llama2 pulling manifest Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp: lookup registry.ollama.ai: no such host ``` I then added a manual dns entry to /etc/hosts and ran the command again, but this time after trying to fetch the manifest, I get ``` > HTTPS_PROXY=http://REDACTED.XXX:10000 ollama run llama2 pulling manifest Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp 34.120.132.20:443: connect: network is unreachable ``` Going to those urls in Safari works just fine so it seems that the proxy support isn't fully working.
Author
Owner

@mxyng commented on GitHub (Dec 15, 2023):

HTTPS_PROXY must be applied to ollama serve since that's the process actually reaching out to get the models. setting it with ollama run has no effect. Please see the FAQ for more details.

<!-- gh-comment-id:1858228015 --> @mxyng commented on GitHub (Dec 15, 2023): `HTTPS_PROXY` must be applied to `ollama serve` since that's the process actually reaching out to get the models. setting it with `ollama run` has no effect. Please see the [FAQ](https://github.com/jmorganca/ollama/blob/main/docs/faq.md#how-do-i-use-ollama-behind-a-proxy) for more details.
Author
Owner

@pardeike commented on GitHub (Dec 15, 2023):

My bad, I did not realise that the Ollama app had put itself in my menu bar. After quitting it, then running the proxied ollama serve from command line I could run ollama run llama2 as intended.

<!-- gh-comment-id:1858239940 --> @pardeike commented on GitHub (Dec 15, 2023): My bad, I did not realise that the Ollama app had put itself in my menu bar. After quitting it, then running the proxied ollama serve from command line I could run `ollama run llama2` as intended.
Author
Owner

@GuiZhaoyang commented on GitHub (Dec 28, 2023):

@mxyng hi, I run the ollama run llama2 in terminal,but still meet the error:

pulling manifest
Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp 34.120.132.20:443: connect: network is unreachable

The ollama server logs:
2023/12/28 11:38:48 images.go:1066: request failed: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp 34.120.132.20:443: connect: network is unreachable
[GIN] 2023/12/28 - 11:38:48 | 200 | 267.776118ms | 127.0.0.1 | POST "/api/pull"

<!-- gh-comment-id:1870796632 --> @GuiZhaoyang commented on GitHub (Dec 28, 2023): @mxyng hi, I run the ollama run llama2 in terminal,but still meet the error: pulling manifest Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp 34.120.132.20:443: connect: network is unreachable The ollama server logs: 2023/12/28 11:38:48 images.go:1066: request failed: Get "https://registry.ollama.ai/v2/library/llama2/manifests/latest": dial tcp 34.120.132.20:443: connect: network is unreachable [GIN] 2023/12/28 - 11:38:48 | 200 | 267.776118ms | 127.0.0.1 | POST "/api/pull"
Author
Owner

@pardeike commented on GitHub (Dec 28, 2023):

Did you run ollama serve with proxy settings @GuiZhaoyang ?

<!-- gh-comment-id:1871113276 --> @pardeike commented on GitHub (Dec 28, 2023): Did you run `ollama serve` with proxy settings @GuiZhaoyang ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#844