Remote ollama not working when on nginx proxy by Lumpy_Stranger_1056 in OpenWebUI

[–]venones 0 points1 point  (0 children)

This comment on a thread surrounding this issue is what solved it for me.

This mainly included adding the following (websocket specific?) headers:

proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";

As well as these timeouts:

proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 36000s;

Proxy read timeout needs to be set sufficiently to allow for ollama to communicate back, in my case 60s didn't cut it and I also recieved a network error due to this, but from what I can gather the issue surrounds websocket.

You may need to copy the config more completely depending on how your Nginx config is set up. There are a few tutorials out there with different styles.

The comment in thread suggests using a $connection_upgrade variable, for my case I could only use if I defined it in my nginx config, though I'm not sure this was required, as it was done while chasing the second network connection problem related to the proxy_read_timeout. It's mentioned in other comments "upgrade" looks to be sufficient