[GH-ISSUE #8050] Ollama behind proxy can't pull new models anymore #5148

Closed
opened 2026-04-12 16:15:16 -05:00 by GiteaMirror · 13 comments
Owner

Originally created by @the-silversurver on GitHub (Dec 11, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/8050

What is the issue?

Hi there,

I am using Ollama on different machines (Ubuntu inside a docker container together with open web ui and on a Mac standalone) within a university that enforces the use of a proxy to access the internet.

On both systems, the proxy is correctly configured and Ollama worked with it, be it via zsh
ollama pull modelname
or
via open web ui.
Now on both systems pulling new models does not work anymore.
The Ollama container at the ubuntu server says:

time=2024-12-11T14:34:35.279Z level=INFO source=images.go:990 msg="request failed: Get \"http://registry.ollama.ai/v2/library/qwen2.5-coder/manifests/latest\": dial tcp 104.21.75.227:80: connect: connection refused" [GIN] 2024/12/11 - 14:34:35 | 200 | 55.03224ms | 172.31.1.5 | POST "/api/pull"

On the Mac I get
Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/qwen2.5-coder/manifests/latest": dial tcp 172.67.182.229:443: connect: connection refused

On both systems
wget https://registry.ollama.ai/v2/library/qwen2.5-coder/manifests/latest pulls the manifest correctly.

When I deactivate the LAN connection on the Mac and use WLAN to connect directly to the internet without the proxy, anything works as expected.

This behavior is new to me, as I am running ollama for several months on both machines and never had these issues.
Any hint is highly appreciated

for the Ollama - Ollama web ui on the ubuntu server this is my docker-compose.yml which worked fine in the past

`services:
ollama:
deploy:
resources:
reservations:
devices:
- driver: ${OLLAMA_GPU_DRIVER-nvidia}
count: all
capabilities:
- gpu
volumes:
- /docker-apps/ollama-web-ui/volumes/ollama:/root/.ollama
container_name: ollama
pull_policy: always
tty: true
restart: unless-stopped
image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest}
environment:
- HTTP_PROXY=http://proxy.my-uni.tld:8080
- HTTPS_PROXY=http://proxy.my-uni.tld:8080
- NO_PROXY=localhost,127.0.0.1,.my-uni.tld
ports:
- 11434:11434
networks:
- ollama_network

open-webui:
build:
context: .
args:
OLLAMA_BASE_URL: '/ollama'
dockerfile: Dockerfile
image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
container_name: open-webui
volumes:
- /docker-apps/ollama-web-ui/volumes/open-web-ui:/app/backend/data
depends_on:
- ollama
networks:
- ollama_network
environment:
- 'OLLAMA_BASE_URL=https://quest-gpu-06.my-uni.tld'
- 'WEBUI_SECRET_KEY=xyz'
- HTTP_PROXY=http://proxy.my-uni.tld:8080
- HTTPS_PROXY=http://proxy.my-uni.tld:8080
- NO_PROXY=localhost,127.0.0.1,.my-uni.tld
extra_hosts:
- host.docker.internal:host-gateway
restart: unless-stopped
ports:
- 8080:8080

networks:
ollama_network:
external: true`

OS

Linux, macOS

GPU

Nvidia, Apple

CPU

AMD, Apple

Ollama version

0.4.4

Originally created by @the-silversurver on GitHub (Dec 11, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/8050 ### What is the issue? Hi there, I am using Ollama on different machines (Ubuntu inside a docker container together with open web ui and on a Mac standalone) within a university that enforces the use of a proxy to access the internet. On both systems, the proxy is correctly configured and Ollama worked with it, be it via zsh ollama pull modelname or via open web ui. Now on both systems pulling new models does not work anymore. The Ollama container at the ubuntu server says: `time=2024-12-11T14:34:35.279Z level=INFO source=images.go:990 msg="request failed: Get \"http://registry.ollama.ai/v2/library/qwen2.5-coder/manifests/latest\": dial tcp 104.21.75.227:80: connect: connection refused" [GIN] 2024/12/11 - 14:34:35 | 200 | 55.03224ms | 172.31.1.5 | POST "/api/pull" ` On the Mac I get `Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/qwen2.5-coder/manifests/latest": dial tcp 172.67.182.229:443: connect: connection refused` On both systems `wget https://registry.ollama.ai/v2/library/qwen2.5-coder/manifests/latest` pulls the manifest correctly. When I deactivate the LAN connection on the Mac and use WLAN to connect directly to the internet without the proxy, anything works as expected. This behavior is new to me, as I am running ollama for several months on both machines and never had these issues. Any hint is highly appreciated for the Ollama - Ollama web ui on the ubuntu server this is my docker-compose.yml which worked fine in the past `services: ollama: deploy: resources: reservations: devices: - driver: ${OLLAMA_GPU_DRIVER-nvidia} count: all capabilities: - gpu volumes: - /docker-apps/ollama-web-ui/volumes/ollama:/root/.ollama container_name: ollama pull_policy: always tty: true restart: unless-stopped image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest} environment: - HTTP_PROXY=http://proxy.my-uni.tld:8080 - HTTPS_PROXY=http://proxy.my-uni.tld:8080 - NO_PROXY=localhost,127.0.0.1,.my-uni.tld ports: - 11434:11434 networks: - ollama_network open-webui: build: context: . args: OLLAMA_BASE_URL: '/ollama' dockerfile: Dockerfile image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main} container_name: open-webui volumes: - /docker-apps/ollama-web-ui/volumes/open-web-ui:/app/backend/data depends_on: - ollama networks: - ollama_network environment: - 'OLLAMA_BASE_URL=https://quest-gpu-06.my-uni.tld' - 'WEBUI_SECRET_KEY=xyz' - HTTP_PROXY=http://proxy.my-uni.tld:8080 - HTTPS_PROXY=http://proxy.my-uni.tld:8080 - NO_PROXY=localhost,127.0.0.1,.my-uni.tld extra_hosts: - host.docker.internal:host-gateway restart: unless-stopped ports: - 8080:8080 networks: ollama_network: external: true` ### OS Linux, macOS ### GPU Nvidia, Apple ### CPU AMD, Apple ### Ollama version 0.4.4
GiteaMirror added the networkingneeds more infobug labels 2026-04-12 16:15:16 -05:00
Author
Owner

@rick-github commented on GitHub (Dec 11, 2024):

What, if anything, changed? Ollama upgrade? Proxy update? Server logs would be useful.

<!-- gh-comment-id:2536603071 --> @rick-github commented on GitHub (Dec 11, 2024): What, if anything, changed? Ollama upgrade? Proxy update? Server logs would be useful.
Author
Owner

@bmizerany commented on GitHub (Dec 11, 2024):

@the-silversurver I'm not sure if this might help, but do you mind trying again with HTTPS_PROXY set to https instead of http in the url scheme and see if that affects anything?

<!-- gh-comment-id:2536649485 --> @bmizerany commented on GitHub (Dec 11, 2024): @the-silversurver I'm not sure if this might help, but do you mind trying again with HTTPS_PROXY set to https instead of http in the url scheme and see if that affects anything?
Author
Owner

@bmizerany commented on GitHub (Dec 11, 2024):

It also might be worth trying to unset HTTP_PROXY and leave the HTTPS_PROXY as you had it.

<!-- gh-comment-id:2536691403 --> @bmizerany commented on GitHub (Dec 11, 2024): It also might be worth trying to unset HTTP_PROXY and leave the HTTPS_PROXY as you had it.
Author
Owner

@44cort44 commented on GitHub (Dec 18, 2024):

This indeed broke between 0.5.1 and 0.5.2. I installed the update to 0.5.4 today and noticed it broke. I rolled back to 0.5.3, then 0.5.2 and it was still broken there. When I rolled back to 0.5.1 the problem was resolved.

<!-- gh-comment-id:2551823933 --> @44cort44 commented on GitHub (Dec 18, 2024): This indeed broke between 0.5.1 and 0.5.2. I installed the update to 0.5.4 today and noticed it broke. I rolled back to 0.5.3, then 0.5.2 and it was still broken there. When I rolled back to 0.5.1 the problem was resolved.
Author
Owner

@rick-github commented on GitHub (Dec 18, 2024):

Server logs would be useful.

<!-- gh-comment-id:2552057729 --> @rick-github commented on GitHub (Dec 18, 2024): Server logs would be useful.
Author
Owner

@44cort44 commented on GitHub (Dec 18, 2024):

Using Ollama 0.5.2 it doesn't work (ollama pull qwen2.5)

[GIN] 2024/12/18 - 10:42:37 | 200 |            0s |       127.0.0.1 | GET      "/api/version"
[GIN] 2024/12/18 - 10:42:42 | 200 |            0s |       127.0.0.1 | HEAD     "/"
time=2024-12-18T10:42:42.526-06:00 level=INFO source=images.go:994 msg="request failed: Get \"https://registry.ollama.ai/v2/library/qwen2.5/manifests/latest\": read tcp xxx.xxx.xxx.xxx:xxxxx->yyy.yyy.yyy.yyy:yyyyy: wsarecv: An existing connection was forcibly closed by the remote host."
[GIN] 2024/12/18 - 10:42:42 | 200 |    185.1261ms |       127.0.0.1 | POST     "/api/pull"

Note: I redacted the IP addresses

Using Ollama 0.5.1(ollama rm qwen2.5 followed by ollama pull qwen2.5)

[GIN] 2024/12/18 - 13:10:23 | 200 |            0s |       127.0.0.1 | HEAD     "/"
[GIN] 2024/12/18 - 13:10:23 | 200 |      2.1541ms |       127.0.0.1 | POST     "/api/generate"
[GIN] 2024/12/18 - 13:10:23 | 200 |      23.122ms |       127.0.0.1 | DELETE   "/api/delete"
[GIN] 2024/12/18 - 13:10:36 | 200 |            0s |       127.0.0.1 | HEAD     "/"
time=2024-12-18T13:10:37.312-06:00 level=INFO source=download.go:175 msg="downloading eb4402837c78 in 1 1.5 KB part(s)"
time=2024-12-18T13:10:38.568-06:00 level=INFO source=download.go:175 msg="downloading 2f15b3218f05 in 1 487 B part(s)"
[GIN] 2024/12/18 - 13:10:39 | 200 |    3.2167535s |       127.0.0.1 | POST     "/api/pull"

in both of these, both the HTTP and HTTPS proxy environment variables are set and show up at the top of the server.log file when the server starts.

if I modify the proxy settings to ONLY have the HTTPS proxy variable set, it still doesn't work in 0.5.2 and later:
HTTPS_PROXY:http://my-corporate-proxy:80 <-- this is http (and not https) on purpose.
HTTP_PROXY:
NO_PROXY:localhost, 127.0.0.1, host.docker.internal

<!-- gh-comment-id:2552071726 --> @44cort44 commented on GitHub (Dec 18, 2024): Using Ollama 0.5.2 it doesn't work (ollama pull qwen2.5) ``` [GIN] 2024/12/18 - 10:42:37 | 200 | 0s | 127.0.0.1 | GET "/api/version" [GIN] 2024/12/18 - 10:42:42 | 200 | 0s | 127.0.0.1 | HEAD "/" time=2024-12-18T10:42:42.526-06:00 level=INFO source=images.go:994 msg="request failed: Get \"https://registry.ollama.ai/v2/library/qwen2.5/manifests/latest\": read tcp xxx.xxx.xxx.xxx:xxxxx->yyy.yyy.yyy.yyy:yyyyy: wsarecv: An existing connection was forcibly closed by the remote host." [GIN] 2024/12/18 - 10:42:42 | 200 | 185.1261ms | 127.0.0.1 | POST "/api/pull" ``` Note: I redacted the IP addresses Using Ollama 0.5.1(ollama rm qwen2.5 followed by ollama pull qwen2.5) ``` [GIN] 2024/12/18 - 13:10:23 | 200 | 0s | 127.0.0.1 | HEAD "/" [GIN] 2024/12/18 - 13:10:23 | 200 | 2.1541ms | 127.0.0.1 | POST "/api/generate" [GIN] 2024/12/18 - 13:10:23 | 200 | 23.122ms | 127.0.0.1 | DELETE "/api/delete" [GIN] 2024/12/18 - 13:10:36 | 200 | 0s | 127.0.0.1 | HEAD "/" time=2024-12-18T13:10:37.312-06:00 level=INFO source=download.go:175 msg="downloading eb4402837c78 in 1 1.5 KB part(s)" time=2024-12-18T13:10:38.568-06:00 level=INFO source=download.go:175 msg="downloading 2f15b3218f05 in 1 487 B part(s)" [GIN] 2024/12/18 - 13:10:39 | 200 | 3.2167535s | 127.0.0.1 | POST "/api/pull" ``` in both of these, both the HTTP and HTTPS proxy environment variables are set and show up at the top of the server.log file when the server starts. if I modify the proxy settings to ONLY have the HTTPS proxy variable set, it still doesn't work in 0.5.2 and later: HTTPS_PROXY:http://my-corporate-proxy:80 <-- this is http (and not https) on purpose. HTTP_PROXY: NO_PROXY:localhost, 127.0.0.1, host.docker.internal
Author
Owner

@44cort44 commented on GitHub (Dec 19, 2024):

I did a controlled experiment:
I uninstalled Ollama and installed version 0.5.0 and confirmed the model pull worked through the proxy.
After the successful model pull I clicked Ollama option for "restart to update" from the taskbar icon.
After the update, the model pull fails. I've included the before and after redacted server log files.

image

server-0.5.0-works-redacted.log
server-0.5.4-broken-redacted.log

<!-- gh-comment-id:2554973673 --> @44cort44 commented on GitHub (Dec 19, 2024): I did a controlled experiment: I uninstalled Ollama and installed version 0.5.0 and confirmed the model pull worked through the proxy. After the successful model pull I clicked Ollama option for "restart to update" from the taskbar icon. After the update, the model pull fails. I've included the before and after redacted server log files. ![image](https://github.com/user-attachments/assets/d4056218-a982-4aa9-92b1-31f7213861ed) [server-0.5.0-works-redacted.log](https://github.com/user-attachments/files/18200632/server-0.5.0-works-redacted.log) [server-0.5.4-broken-redacted.log](https://github.com/user-attachments/files/18200633/server-0.5.4-broken-redacted.log)
Author
Owner

@44cort44 commented on GitHub (Dec 21, 2024):

I'm unable to confirm the specifics, but someone else in my company was recently working with a supplier of a application that was experiencing similar issues within the last 2 weeks. Their troubleshooting apparently revealed that a nested/indirect dependency on nodejs had a version change causing an update to nodejs that was the root cause of the issue for that particular application breaking connections through proxies. Investigating the nodejs dependency versions between 0.5.1 and 0.5.2 might a fruitful exercise.

<!-- gh-comment-id:2557971623 --> @44cort44 commented on GitHub (Dec 21, 2024): I'm unable to confirm the specifics, but someone else in my company was recently working with a supplier of a application that was experiencing similar issues within the last 2 weeks. Their troubleshooting apparently revealed that a nested/indirect dependency on nodejs had a version change causing an update to nodejs that was the root cause of the issue for that particular application breaking connections through proxies. Investigating the nodejs dependency versions between 0.5.1 and 0.5.2 might a fruitful exercise.
Author
Owner

@rick-github commented on GitHub (Dec 21, 2024):

There are no nodejs dependencies in ollama.

<!-- gh-comment-id:2557977363 --> @rick-github commented on GitHub (Dec 21, 2024): There are no nodejs dependencies in ollama.
Author
Owner

@44cort44 commented on GitHub (Jan 7, 2025):

I got a chance to troubleshoot this with my corporate proxy guy, and was able to resolve this in our corporate proxy configuration by "bypassing TLS acceleration for registry.ollama.ai".

Here's what he had to say:
The proxy isn't decrypting this traffic, but it does try to "help" with the TLS encryption handshake. Some sites don't follow the RFC for HTTPS exactly, so the proxy just ends up messing up the connection. The solution is to tell the proxy not to accelerate the handshake for a specific URL.

<!-- gh-comment-id:2576308018 --> @44cort44 commented on GitHub (Jan 7, 2025): I got a chance to troubleshoot this with my corporate proxy guy, and was able to resolve this in our corporate proxy configuration by "bypassing TLS acceleration for registry.ollama.ai". Here's what he had to say: The proxy isn't decrypting this traffic, but it does try to "help" with the TLS encryption handshake. Some sites don't follow the RFC for HTTPS exactly, so the proxy just ends up messing up the connection. The solution is to tell the proxy not to accelerate the handshake for a specific URL.
Author
Owner

@rick-github commented on GitHub (Jan 7, 2025):

Can you reveal what proxy you are using?

<!-- gh-comment-id:2576321152 --> @rick-github commented on GitHub (Jan 7, 2025): Can you reveal what proxy you are using?
Author
Owner

@44cort44 commented on GitHub (Jan 7, 2025):

Can you reveal what proxy you are using?

Bluecoat proxy

<!-- gh-comment-id:2576329308 --> @44cort44 commented on GitHub (Jan 7, 2025): > Can you reveal what proxy you are using? Bluecoat proxy
Author
Owner

@r-gg-b commented on GitHub (Sep 17, 2025):

Adding 0.0.0.0 to the no_proxy environment variable fixed it for me.

<!-- gh-comment-id:3303223587 --> @r-gg-b commented on GitHub (Sep 17, 2025): Adding `0.0.0.0` to the `no_proxy` environment variable fixed it for me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5148