Enable CORS

GeoServer Tutorials > Change Data Directory Location

CORS is enabled by default on both GeoServer cPanel and GeoServer Dedicated hosting

Below is provided in case you wish to remove, update, or ammend.

 

1. Stop Tomcat

 

2. Connect via SSH and move the Tomcat WEB-INF directory

 

3. Add the following above the closing </web-app> tag

 

<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
</init-param>
</filter>
<filter-mapping> <filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

 

Important: Above is a permissive CORS configuration. You should adjust to suit your needs and requirements.
 
5. Start Tomcat

 

 

 

 

Clients and Sectors

AcuGIS provides GIS Hosting Services to customers in over 80 countries worlwide.

International

International governmental institutions. Email gov@acugis.com

Government

Local, State, and Federal Governments. Email gov@acugis.com

Academia

iscounts for Academic institutions. Email edu@acugis.com

NGO

Non-Governmental Organizations. Email edu@acugis.com

Research

Public and Private Research institutions. Email edu@acugis.com

Developers

Developer-friendly tools and great features