CORS localhost error

0

Hi Guys I have two origins, S3 for react app, and LB for backend server.

On my localhost I am calling api endpoint with LB/api and everything is working, no CORS error, when calling with full subdomain name which is connected to CF, I am getting CORS error. I tried all options below nothing is working. https://repost.aws/knowledge-center/no-access-control-allow-origin-error Any ideas and suggestion? thanks

ozy
asked a year ago443 views
1 Answer
0

Considering you have tried all the options suggested in the KC link you mentioned , you may want to enable CloudFront logging if not already and review the logs to see if they provide any additional insight into the issue. Additionally, you could consider reaching out to AWS support for assistance with troubleshooting the issue.

You can enable CloudFront logging by following these steps:

Open the AWS Management Console and navigate to the CloudFront dashboard. Click on the distribution for which you want to enable logging. Click on the "Distribution Settings" tab. Scroll down to the "Logging" section and click "Edit". Select "On" for "Enable Logging". Enter a name for the S3 bucket that will store the log files. (Optional) Enter a prefix to be added to the log file names. Click "Yes, Edit" to save the changes. Once you have enabled logging, CloudFront will start writing log files to the specified S3 bucket. The log files will be in a specific format, and will contain information such as the time of the request, the client's IP address, the requested URL, and the response code.

You can then use tools such as Amazon Athena, Amazon EMR, or your own custom scripts to analyze the log data and gain insight into the traffic patterns and usage of your CloudFront distribution.

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions