diff options
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/nginx.conf | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000..49cd069 --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,27 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + + # SPA fallback — let React Router handle unknown paths + location / { + try_files $uri $uri/ /index.html; + } + + # Proxy Ollama's API through the same origin so the browser never has to + # make a cross-origin request and CORS is a non-issue. + # In the app's Settings panel, set the Ollama base URL to just: + # http://<your-server> (no port, no path suffix) + location /api/ { + proxy_pass http://ollama:11434/api/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # Ollama responses (especially streamed ones) can be large and slow; + # disable buffering so cancellation works promptly. + proxy_buffering off; + proxy_read_timeout 120s; + } +} |
