0

Hi I am making an Ajax call cross domains but on the same machine. In apache I have created a virtual host and setup ProxyPass and ProxyPassReverse.

when I make my ajax call in ie It works but on all subsequent calls it returns the same value, even though I know this value has changed.

In chrome I get the error Origin

         http://myip is not allowed by Access-Control-Allow-Origin. 

Do I still have some configuration in apache to do or do I need to change something in the browser??

thanks for any thoughts

Jason Millington
  • 691
  • 1
  • 5
  • 11

1 Answers1

0

There is a technique called Cross-origin resource sharing (CORS). Basically you need to spacify a special HTTP haeder to allow cross domain access:

Access-Control-Allow-Origin: http://www.example.com

If you have installed the mod_headers you can try to add this line to your htaccess file or server configuration:

Header add Access-Control-Allow-Origin "http://www.example.com"

If you want to allow general access from all domains like for public API allow all domains with the asterisk:

Header add Access-Control-Allow-Origin "*"
rekire
  • 47,260
  • 30
  • 167
  • 264