Cors is not enable in the server


I Am facing an error tha CORS is not enable in the sever. My Hosting Provider is AMAZON AWS and my DNS manage by cloudflare so where i can enable the CORS ?

Thank You

Cloudflare includes the Origin request header in the cache key, and passes the Origin header to your origin. You need to add any relevant CORS headers in whatever AWS service you are using. (For example, if you see “Origin:” you might add “Access-Control-Allow-Origin:”, while adding nothing if you see any other Origin value)

You could also build a worker to add the headers, but I would look at your AWS service first.


Sir can you please help me to add the header line in AWS ? I am using AWS Ec2 instance T2 small.

Thank you

At a basic level, and if you are running Apache on your EC2 instance, add this to your .htaccess file:

Header set Access-Control-Allow-Origin “*”

(Using a wildcard like this is not recommended).


Sir I am using Ubantu server so is it work if I add in my .htaccess file: ?

Thank you

This topic was automatically closed after 14 days. New replies are no longer allowed.