refactor: Caddy for s3
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -55,6 +55,23 @@
|
||||
}
|
||||
|
||||
{$CDN_DOMAIN:cdn.yourdomain.com} {
|
||||
# Browser-direct presigned PUT uploads need a storage CORS preflight.
|
||||
# Garage's default bucket policy only advertises GET, so handle the
|
||||
# browser preflight at the public edge and expose multipart ETags.
|
||||
@storage_preflight method OPTIONS
|
||||
header @storage_preflight {
|
||||
Access-Control-Allow-Origin "{http.request.header.Origin}"
|
||||
Access-Control-Allow-Methods "GET, HEAD, PUT, POST, DELETE, OPTIONS"
|
||||
Access-Control-Allow-Headers "*"
|
||||
Access-Control-Max-Age "86400"
|
||||
}
|
||||
respond @storage_preflight 204
|
||||
|
||||
header {
|
||||
Access-Control-Allow-Origin "*"
|
||||
Access-Control-Expose-Headers "ETag, Content-Length, Content-Range, Accept-Ranges, Content-Disposition"
|
||||
}
|
||||
|
||||
reverse_proxy localhost:3900 {
|
||||
header_up X-Real-IP {http.request.header.X-Real-IP}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user