Enable CORS
Enable CORS for specific Domains
Please add the following configuration change using your top-level domain value in the web.xml to enable CORS.
Update the file web.xml (Windows: C:\SearchBloxServer\webapps\ROOT\WEB-INF\web.xml Linux: /opt/searchblox/webapps/ROOT/WEB-INF/web.xml) to make this change:
To allow single domain, edit as shown below:
<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>https://www.searchblox.com</param-value>
</init-param>
or to allow multiple domains, edit as shown below separated by space between the domain values:
<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>https://localhost:8443 https://localhost:8444 https://localhost:8446</param-value>
</init-param>
Please save web.xml file and restart the SearchBlox service.
![Screenshot 2020-07-24 at 9.11.25 PM.png 1412](https://files.readme.io/0e73da9-Screenshot_2020-07-24_at_9.11.25_PM.png)
Updated almost 3 years ago