Last active
November 16, 2024 07:17
-
-
Save sirodoht/69d88db69679b4cddbc022af1378c642 to your computer and use it in GitHub Desktop.
Caddyfile for ollama with basic auth
This file contains hidden or 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
# /etc/caddy/Caddyfile | |
api.example.com:443 { | |
route { | |
@options method OPTIONS | |
handle @options { | |
header Access-Control-Allow-Origin "https://clientwebsite.com" | |
header Access-Control-Allow-Methods "POST" | |
header Access-Control-Allow-Headers "authorization" | |
header Access-Control-Allow-Credentials true | |
respond "" 204 | |
} | |
header ?Access-Control-Allow-Origin "https://clientwebsite.com" | |
header Access-Control-Allow-Methods "POST" | |
header Access-Control-Allow-Headers "authorization" | |
header Access-Control-Allow-Credentials true | |
basicauth { | |
admin $2a$14$xxx | |
} | |
reverse_proxy 127.0.0.1:11434 | |
} | |
} |
This file contains hidden or 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
# /etc/systemd/system/ollama.service.d/environment.conf | |
# https://github.com/jmorganca/ollama/blob/2a2fa3c3298194f4f3790aade78df2f53d170d8e/docs/faq.md#how-do-i-use-ollama-server-environment-variables-on-linux | |
[Service] | |
Environment="OLLAMA_HOST=0.0.0.0:11434" | |
Environment="OLLAMA_ORIGINS=http://192.168.1.1:*,https://clientwebsite.com:*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment