CORS troubleshooting
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
ai-gateway.ldex.dev {
|
||||
# 1. Force CORS headers for every request
|
||||
# 1. Force CORS headers and DELETE duplicates from backend
|
||||
header {
|
||||
-Access-Control-Allow-Origin
|
||||
-Access-Control-Allow-Methods
|
||||
-Access-Control-Allow-Headers
|
||||
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)
|
||||
# 2. Immediately handle OPTIONS requests
|
||||
@options {
|
||||
method OPTIONS
|
||||
}
|
||||
@@ -15,6 +18,6 @@ ai-gateway.ldex.dev {
|
||||
respond "" 204
|
||||
}
|
||||
|
||||
# 3. Proxy everything else to the app
|
||||
# 3. Proxy everything else
|
||||
reverse_proxy ai-gateway:8000
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user