S3 Cors for Standard Object Storage
... / S3 Cors for Standard Obje...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

S3 Cors for Standard Object Storage

by
RadoslawS1
Created on 2024-09-02 16:25:41 (edited on 2024-09-04 14:24:42) in Storage and Backup-old

Hi everyone.
I'm using Twill with Laravel. Configured it to use S3 Object storage, and PHP seems to upload files, but not a frontend side of Twill (Media Library). Its causing CORS issue:

> Access to XMLHttpRequest at 'https://neloroot.s3.waw.io.cloud.ovh.net/' from origin 'http://backoffice.nelo.local' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I'm testing it with local domain set up with docker, but prod is on kubernetes cluster, and the same error occurs. Attaching screenshots from Chrome Dev Console
!Screenshot%20from%202024-08-26%2010-09-35|690x336!Screenshot%20from%202024-08-26%2010-10-14|690x357

I've followed S3 Cors setup from OVH Docs, and seems like they correctly set up:
`

> aws s3api --endpoint-url https://s3.waw.io.cloud.ovh.net/ put-bucket-cors --bucket neloroot --cors-configuration file://cors.json --output json

`

> CORS file:
> {
> "CORSRules": [
> {
> "AllowedHeaders": [
> "*"
> ],
> "AllowedMethods": [
> "HEAD",
> "GET",
> "POST",
> "DELETE"
> ],
> "AllowedOrigins": [
> "backoffice.nelo.local"
> ],
> "ExposeHeaders": [
> "Access-Control-Allow-Origin"
> ],
> "MaxAgeSeconds": 3000
> }
> ]
> }

Has anyone experienced this issue, or is there any other configuration I should perform?


1 Reply ( Latest reply on 2025-01-31 09:00:03 by
Tekfor
)

Same here. I managed to fix CORS issue but now I get 501 / Not Implemented status.