If you have VertiGIS Studio Search installed on-prem, you may need to configure its Cross-Origin Resource Sharing (CORS) settings to get it to work successfully with Web apps from a different origin. This could apply to you if:
- You have VertiGIS Studio Search installed on-prem, but use SaaS VertiGIS Studio Web.
- You have both VertiGIS Studio Search and VertiGIS Studio Web installed on-prem, but have them on separate servers.
Configuration Steps:
-
On the server where VertiGIS Studio Search is installed, open the backend configuration .env file in a text editor like Notepad++. Its default location is in C:\Program Files\VertiGIS\VertiGIS Studio Search\search\Engine\bin\search-modules\
- Find the CORS section. By default, it is disabled (commented out). NOTE: The CORS section may look different from the screenshots depending on your version of VertiGIS Studio Search.
- Remove the first "#" character from every line in this section that contains "%search-api.quarkus.http.cors" to uncomment it.
- If any of the "%search-api.quarkus.http.cors" entries from the above screenshot are missing, add them manually. For ease of copy/pasting them, here they are as text:
%search-api.quarkus.http.cors=true
%search-api.quarkus.http.cors.origins=
%search-api.quarkus.http.cors.methods=GET,PUT,POST
%search-api.quarkus.http.cors.access-control-max-age=24H
%search-api.quarkus.http.cors.access-control-allow-credentials=true
- Directly after "%search-api.quarkus.http.cors.origins=", add the origin from which you would like to allow access to Search. For example, https://apps.vertigisstudio.com for SaaS Web apps or https://[server].[domain] for on-prem installations of Web. If other entries already exist, they can be comma-separated.
- Save the file and close it.
- In the Windows Services application, restart the VertiGIS Studio Search Engine (API) service to reload the configuration.
Once these steps are complete, you should no longer see CORS errors when you attempt to run your searches from your Web apps.
Comments
0 comments
Article is closed for comments.