Merged Caddy into docker-compose and added edge CORS handling

This commit is contained in:
2026-02-10 21:34:54 +08:00
parent e83bb522a4
commit 36530eb2c5
2 changed files with 44 additions and 10 deletions

20
Caddyfile Normal file
View File

@@ -0,0 +1,20 @@
ai-gateway.ldex.dev {
# 1. Force CORS headers for every request
header {
Access-Control-Allow-Origin *
Access-Control-Allow-Methods "GET, POST, OPTIONS"
Access-Control-Allow-Headers "*"
Access-Control-Expose-Headers "*"
}
# 2. Immediately handle OPTIONS requests (the preflight)
@options {
method OPTIONS
}
handle @options {
respond "" 204
}
# 3. Proxy everything else to the app
reverse_proxy ai-gateway:8000
}