Search code examples
ajaxxmlcorsgoogle-search-appliance

By passing CORS (AJAX & XML) with Google Search Appliance


We are currently implementing the search appliance for one of our newly redesigned website. The solution designed involves in making AJAX calls to the search appliance to pull suggestions and search results. The suggestions work well as expected but the search results are running into CORS issue.

Technically the website and search appliance belong to the same domain but different subdomains. Is there any way within the GSA console to allow requests from another domain or any subdomain belonging to the same domain as the GSA?

Forex : From web.example.com To gsa.example.com


Solution

  • Place a HA Proxy in front of the GSA.

    Configure it to set the below HTTP header in the response. See this example to set custom headers.

    Access-Control-Allow-Origin: *
    

    This is the only way you can resolve your issue.