[GH-ISSUE #2291] Allow requests from Tauri #27081

Closed
opened 2026-04-22 04:01:40 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @da-z on GitHub (Jan 31, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2291

Originally assigned to: @bmizerany on GitHub.

$ OLLAMA_ORIGINS=tauri://localhost ollama serve

panic: bad origin: origins must contain '*' or include http://,https://,chrome-extension://,safari-extension://,moz-extension://,ms-browser-extension://

Workaround (updated):

OLLAMA_ORIGINS=*://localhost ollama serve

Besides adding the tauri:// schema, maybe also enable access by default for tauri://localhost and tauri://127.0.0.1

Originally created by @da-z on GitHub (Jan 31, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2291 Originally assigned to: @bmizerany on GitHub. `$ OLLAMA_ORIGINS=tauri://localhost ollama serve` panic: bad origin: origins must contain '*' or include http://,https://,chrome-extension://,safari-extension://,moz-extension://,ms-browser-extension:// Workaround (updated): ```shell OLLAMA_ORIGINS=*://localhost ollama serve ``` Besides adding the tauri:// schema, maybe also enable access by default for tauri://localhost and tauri://127.0.0.1
GiteaMirror added the bug label 2026-04-22 04:01:40 -05:00
Author
Owner

@da-z commented on GitHub (Jan 31, 2024):

Checking the ollama code, it seems to be Gin Cors - related. Opened https://github.com/gin-contrib/cors/issues/135

<!-- gh-comment-id:1919930122 --> @da-z commented on GitHub (Jan 31, 2024): Checking the ollama code, it seems to be Gin Cors - related. Opened https://github.com/gin-contrib/cors/issues/135
Author
Owner

@da-z commented on GitHub (Feb 16, 2024):

Note: above workaround does not seem to work on Windows (is OLLAMA_ORIGINS env var ignored?)

Also, see PR https://github.com/ollama/ollama/pull/2441 which prepares the code for adding extra schemes, like tauri://

<!-- gh-comment-id:1948874781 --> @da-z commented on GitHub (Feb 16, 2024): Note: above workaround does not seem to work on Windows (is OLLAMA_ORIGINS env var ignored?) Also, see PR https://github.com/ollama/ollama/pull/2441 which prepares the code for adding extra schemes, like tauri://
Author
Owner

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

Thank you for the update about Gin. We'll look into bumping our gin version.

<!-- gh-comment-id:1989636685 --> @bmizerany commented on GitHub (Mar 11, 2024): Thank you for the update about Gin. We'll look into bumping our gin version.
Author
Owner

@da-z commented on GitHub (Mar 12, 2024):

Thanks. In https://github.com/ollama/ollama/pull/2441 I bumped Gin CORS (well, go mod updated a bit more than that) and added support by default for requests comming from Tauri apps (like my LLaMazing app). Motivation being to not ask users to fiddle with OLLAMA_ORIGINS.

<!-- gh-comment-id:1990800236 --> @da-z commented on GitHub (Mar 12, 2024): Thanks. In https://github.com/ollama/ollama/pull/2441 I bumped Gin CORS (well, go mod updated a bit more than that) and added support by default for requests comming from Tauri apps (like my [LLaMazing](https://github.com/da-z/llamazing) app). Motivation being to not ask users to fiddle with OLLAMA_ORIGINS.
Author
Owner

@bmizerany commented on GitHub (Mar 12, 2024):

Note: above workaround does not seem to work on Windows (is OLLAMA_ORIGINS env var ignored?)

Also, see PR #2441 which prepares the code for adding extra schemes, like tauri://

Can you confirm if you're still experiencing the issue where the OLLAMA_ORIGINS environment variable appears to be disregarded on Windows? If this problem persists, we're more than willing to investigate further and will consider opening a new issue to address this specifically.

Regarding PR #2441, while we appreciate the initiative to prepare the code for additional schemes like tauri://, we currently do not plan to include default support for Tauri in our CORS headers, as the wildcard * can be used for broader access. However, we truly value your contribution and will keep this in mind for future updates.

I'll be closing this thread for now, but please don't hesitate to reopen a new issue regarding the OLLAMA_ORIGINS on Windows if the problem continues, or reach out directly here, and I'll be happy to assist further.

<!-- gh-comment-id:1992302845 --> @bmizerany commented on GitHub (Mar 12, 2024): > Note: above workaround does not seem to work on Windows (is OLLAMA_ORIGINS env var ignored?) > > Also, see PR #2441 which prepares the code for adding extra schemes, like tauri:// Can you confirm if you're still experiencing the issue where the OLLAMA_ORIGINS environment variable appears to be disregarded on Windows? If this problem persists, we're more than willing to investigate further and will consider opening a new issue to address this specifically. Regarding PR #2441, while we appreciate the initiative to prepare the code for additional schemes like `tauri://`, we currently do not plan to include default support for Tauri in our CORS headers, as the wildcard `*` can be used for broader access. However, we truly value your contribution and will keep this in mind for future updates. I'll be closing this thread for now, but please don't hesitate to reopen a new issue regarding the OLLAMA_ORIGINS on Windows if the problem continues, or reach out directly here, and I'll be happy to assist further.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#27081