Nikitin Mikhail Nikitin Mikhail - 2 months ago 11
Apache Configuration Question

How to get apache server to send specific header

I have an apache 2.2 server with the app deployed. it has accessable from outer ip's simple soap API. SOAP queries being send via soapUI are processed correctly but being called from javascript like this:

xmlHttp.open("GET", url + "?wsdl", async);


I get the following:


XMLHttpRequest cannot load https:url?wsdl. No
'Access-Control-Allow-Origin' header is present on the requested
resource. Origin '...' is therefore not allowed access.


So I've found that I need to get apache 2.2 server to send


Access-Control-Allow-Origin


header, but how?

or maybe it must be configured on the app side?

Answer

Setting headers is relatively trivial.

Header set Access-Control-Allow-Origin "*"

You will probably want to wrap it in a <Location>, <Directory> or <File> block.

Comments