P
P
Pavel2019-05-16 08:52:32
Amazon Web Services
Pavel, 2019-05-16 08:52:32

How to enable CORS in AWS Elastick Beanstalk?

On AWS there is a PHP apishka, EC2 instance, as I understand it, on apache. I tried to add lines to .htaccess

Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"

did not help.
Maybe somewhere in the AWS admin panel you can enable it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2019-05-16
@Palych_tw

Give in the headers of your apishka

S
SagePtr, 2019-05-16
@SagePtr

You need to give in the Access-Control-Allow-Origin header not *, but the requested Origin.
The asterisk option is not suitable for preflight requests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question