Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: CORS Policy error |
|
Author |
|
Daniel Hidalgo
Joined: 19 Dec 2017 Posts: 2 Location: Costa Rica
|
Posted: Tue 19 Dec '17 21:17 Post subject: CORS Policy error |
|
|
I am trying to give access an app outside the domain and is giving me the following error:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://abc.intranet.com' is therefore not allowed access.
i aplied the CORS policy in the conf file:
#~~~~~ Virtual Hosts ~~~~~#
<VirtualHost *>
ServerName CDE.intranet.com
DocumentRoot "/usr/WAS/IBM/assets"
Header always set Access-Control-Allow-Origin:*
but, messed up the sites under the domain
How can i applied the CORS policy to a specific directoy and sudirectory?
Thanks, |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 19 Dec '17 22:02 Post subject: |
|
|
You can use it inside a <Directory block.
Like
Code: |
<Directory "/usr/WAS/IBM/assets/images">
Header always set Access-Control-Allow-Origin:*
</Directory>
|
|
|
Back to top |
|
Daniel Hidalgo
Joined: 19 Dec 2017 Posts: 2 Location: Costa Rica
|
Posted: Tue 19 Dec '17 23:28 Post subject: |
|
|
if i add:
<Directory "/usr/WAS/IBM/assets/images">
Header always set Access-Control-Allow-Origin:*
</Directory>
is giving me 403 errors,
so i did:
<Directory "/usr/WAS/IBM/assets/images">
Header always set Access-Control-Allow-Origin "*"
</Directory>
and still getting the CORS error.
Is there a format i should use, or i need to apply another setting? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 21 Dec '17 18:06 Post subject: |
|
|
okay a 403 is much better than the CORS error
it just means "access denied". So you have to check the permissions. Does the image folder exist? is chmod set correctly? If yes and yes, than you also need to allow the access on apache side. Require all granted |
|
Back to top |
|
|
|
|
|
|