Cross-Origin-Resource-Sharing with Apache for a single file doesnt work, why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, I am new to this mailiing list. I am looking for help regarding a CORS issue with my Apache Server:

I have an Appache Server (2.4) running on my machine, and would like to enable CORS for a certain file.

According to this source I need to do something like the following i my httpd.conf:

<Files "C:/xampp/htdocs/some/path/file.txt">
    Header set Access-Control-Allow-Origin "*"
</Files>

I have added this to my httpd.conf file, saved it, and restarted the server.

However, when trying to get this resource via ajax from a different network, I still get this issue:

XMLHttpRequest cannot load http://SERVERDNS.com/some/path/file.txt. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

How can I fix this? I am not sure if I put the tag in the correct place in httpd.conf, and also I am not sure about whether the Setting itself is done correctly.

I am running this server on a Windows Server 2012 machine on the Amazon Web Services EC2 cloud.

Can anyone shed some light onto this for me?

Thanks, best regards,

Chris


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux