Merged Caddy into docker-compose and added edge CORS handling
This commit is contained in:
20
Caddyfile
Normal file
20
Caddyfile
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user