Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No response when using ollama behind an nginx proxy #52

Open
rwatts3 opened this issue Mar 15, 2024 · 2 comments
Open

No response when using ollama behind an nginx proxy #52

rwatts3 opened this issue Mar 15, 2024 · 2 comments

Comments

@rwatts3
Copy link

rwatts3 commented Mar 15, 2024

I am running ollama on my Google compute instance behind an nginx proxy. I can navigate to the endpoint and confirm /api/tags returns a response as well as other endpoints such as /api/version.

Unfortunately when I add my endpoint via enchanted's settings, I can send a chat, but I never receive a response. I also confirmed that the request is received by ollama via the logs on the server.

@AugustDev
Copy link
Owner

Hi @rwatts3 if you could post a minimum set of instructions to reproduce your environment I'd be happy to go and debug the issue.

@2theo67
Copy link

2theo67 commented May 1, 2024

Hello,
I have the same issue as @rwatts3. I can't tell his setup, however, I can explain mine so it might help you @AugustDev !

Here is my nginx reverse proxy configuration for exposing the API :

upstream ollama {
    server 127.0.0.1:11434;
}

server {
    listen 80;
    listen 443 ssl http2;

    ssl_protocols   TLSv1.3;
    ssl_ciphers     ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
    ssl_prefer_server_ciphers off;

    if ($scheme = http) {
        return 301 https://$host$request_uri;
    }

    location /api/ { # I've tried with and without / at the end of api, but same result
        proxy_pass http://ollama;
        proxy_redirect off;
        proxy_set_header Host       localhost:11434;
    }
}

I'm using a self-signed certificate, and the endpoint configured inside your app is https://<IP>/api
When going to https://<IP>/api/tags from my computer for example, it is returning a result.

Maybe the issue is because I'm using self-signed certificates ?

Well, it seems that not, since I've just disabled https and I'm able to get an answer from http://<IP>/api/tags from my computer.
Inside your app, I then tried these URL without anything working :

  • http://<IP>/api
  • http://<IP>:80/api
  • <IP>/api
  • <IP>:80/api

Between each changes, I'm restarting the app as well.
The app is running on iOS 17.4.1
Echanted version : 1.6.4 (I'm trusting the version number shown by the AppStore)
Ollama version : 0.1.32

If you need more informations don't hesitate to ask, will try to do my best !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants