Open BILAL324 opened 1 month ago
๐ @BILAL324
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ ้ๅธธๆ่ฐขๆจๆไบค issueใๆไปฌไผๅฐฝๅฟซ่ฐๆฅๆญคไบ๏ผๅนถๅฐฝๅฟซๅๅคๆจใ ่ฏท็กฎไฟๆจๅทฒ็ปๆไพไบๅฐฝๅฏ่ฝๅค็่ๆฏไฟกๆฏใ
To resolve the CORS error for a PUT request to your local server (bilalbucke.localhost:9001
) in Docker on Ubuntu using Firefox, you need to ensure that the CORS headers are correctly configured on your server. Based on the provided docker-compose.yml
file, it looks like you are using MinIO, which has CORS settings.
You need to configure the CORS settings for MinIO to allow requests from your local server. Here is how you can do it:
Update the MinIO CORS configuration: Ensure that the MINIO_API_CORS_ALLOW_ORIGIN
environment variable is set correctly to allow requests from your local server. In your docker-compose.yml
, it should look like this:
minio:
image: minio/minio
container_name: lobe-minio
network_mode: 'service:network-service'
volumes:
- './s3_data:/etc/minio/data'
environment:
- 'MINIO_ROOT_USER=${MINIO_ROOT_USER}'
- 'MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}'
- 'MINIO_API_CORS_ALLOW_ORIGIN=http://bilalbucke.localhost:9001'
restart: always
command: >
server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
Set up CORS configuration in MinIO: You need to create a CORS configuration file and apply it to your MinIO server. Here is an example of a CORS configuration JSON file (cors.json
):
[
{
"AllowedOrigins": ["http://bilalbucke.localhost:9001"],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
"AllowedHeaders": ["*"],
"ExposeHeaders": ["ETag"],
"MaxAgeSeconds": 3000
}
]
Apply the CORS configuration: Use the MinIO client (mc) to apply the CORS configuration to your MinIO server. First, install the MinIO client if you haven't already:
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo mv mc /usr/local/bin/
Then, configure the MinIO client and apply the CORS settings:
mc alias set myminio http://localhost:${MINIO_PORT} ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD}
mc admin config set myminio/ api.cors < cors.json
By ensuring that the CORS settings are correctly configured, you should be able to resolve the CORS error for your PUT request [1].
To continue talking to Dosu, mention @dosu.
i did everything the same 200 ok statuscode , but the error is same CORB
can you try with another browser ?
sure, just getting back in few minutes
not working
Bot detected the issue body's language is not English, translate it automatically. ๐ฏ๐ญ๐ป๐งโ๐คโ๐ง๐ซ๐ง๐ฟโ๐คโ๐ง๐ป๐ฉ๐พโ๐คโ๐จ๐ฟ๐ฌ๐ฟ
not working
i means the uabove all solutions are not working
๐ฆ Environment
Docker
๐ Version
latest
๐ป Operating System
Ubuntu
๐ Browser
Firefox
๐ Bug Description
cross origin request block even the request is 200 ok
even that link is accessible
๐ท Recurrence Steps
No response
๐ฆ Expected Behavior
No response
๐ Additional Information
No response