Created
September 25, 2024 00:29
-
-
Save keyboardcrunch/f42b776dc86ebd480f962043a9525444 to your computer and use it in GitHub Desktop.
Nginx proxy Ollama load balancer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Listen on 11434 and proxy requests to a local Ollama server, either by local network or tailscale. | |
# ip_hash should maintain sessions while upstream handles one being offline. | |
# upstream 'load balancing' is used to maintain connectivity while working remote. | |
upstream ollama { | |
ip_hash; | |
server 192.168.1.166:11434; | |
server 100.94.79.62:11434; | |
} | |
server { | |
listen 11434; | |
location / { | |
proxy_set_header Host ollama; | |
proxy_pass http://ollama; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment