I have a application with front end as angular js and api in node.js. Lately, i am unable to use anything due to CORS policy issue. . I tried adding permission in apache virtual host , but nothing seems to be working . Following is the issue statement visible in console. Please help
Access to XMLHttpRequest at ‘https://app.getmanagly.com:3008/login/member/validateMember’ from origin ‘https://app.getmanagly.com’ has been blocked by CORS policy: The ‘Access-Control-Allow-Origin’ header has a value ‘https://app.getmanagly.com:3008’ that is not equal to the supplied origin.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Forgive me if you already know this, but I’m giving all the info in case someone else has the same issue…
The CORS
Access-Control-Allow-Origin
line expects in one of these two formats:Allow everything: probably not what you want
Allow a single specific origin:
subdomain.domain.com
ordomain.com
:80
if your scheme is HTTP and:443
if your scheme is HTTPS.So I think the port is causing your issue: your config is currently only allowing requests from origin
https://app.getmanagly.com:3008
and you need it to allow requests fromhttps://app.getmanagly.com
AKAhttps://app.getmanagly.com:443
Solution: you have three options
https://app.getmanagly.com
FINAL IMPORTANT STEPS:
In order for this to take effect, you need to reload apache AND enable headers
apachectl -t
sudo service apache2 reload
orapachectl -k graceful
a2enmod headers
Forgive me if you already know this, but I’m giving all the info in case someone else has the same issue…
The CORS
Access-Control-Allow-Origin
line expects in one of these two formats:Allow everything: probably not what you want
Allow a single specific origin:
subdomain.domain.com
ordomain.com
:80
if your scheme is HTTP and:443
if your scheme is HTTPS.So I think the port is causing your issue: your config is currently only allowing requests from origin
https://app.getmanagly.com:3008
and you need it to allow requests fromhttps://app.getmanagly.com
AKAhttps://app.getmanagly.com:443
Solution: you have three options
https://app.getmanagly.com
FINAL IMPORTANT STEPS:
In order for this to take effect, you need to reload apache AND enable headers
apachectl -t
sudo service apache2 reload
orapachectl -k graceful
a2enmod headers
Forgive me if you already know this, but I’m giving all the info in case someone else has the same issue…
The CORS
Access-Control-Allow-Origin
line expects in one of these two formats:Allow everything: probably not what you want
Allow a single specific origin:
subdomain.domain.com
ordomain.com
:80
if your scheme is HTTP and:443
if your scheme is HTTPS.So I think the port is causing your issue: your config is currently only allowing requests from origin
https://app.getmanagly.com:3008
and you need it to allow requests fromhttps://app.getmanagly.com
AKAhttps://app.getmanagly.com:443
Solution: you have three options
https://app.getmanagly.com
FINAL IMPORTANT STEPS:
In order for this to take effect, you need to reload apache AND enable headers
apachectl -t
sudo service apache2 reload
orapachectl -k graceful
a2enmod headers
Forgive me if you already know this, but I’m giving all the info in case someone else has the same issue…
The CORS
Access-Control-Allow-Origin
line expects in one of these two formats:Allow everything: probably not what you want
Allow a single specific origin:
subdomain.domain.com
ordomain.com
:80
if your scheme is HTTP and:443
if your scheme is HTTPS.So I think the port is causing your issue: your config is currently only allowing requests from origin
https://app.getmanagly.com:3008
and you need it to allow requests fromhttps://app.getmanagly.com
AKAhttps://app.getmanagly.com:443
Solution: you have three options
https://app.getmanagly.com
FINAL IMPORTANT STEPS:
In order for this to take effect, you need to reload apache AND enable headers
apachectl -t
sudo service apache2 reload
orapachectl -k graceful
a2enmod headers
@aha any luck over the problem …still stuck with this for long time :(