CORS - Tomcat - Geoserver

后端 未结 4 1402
南方客
南方客 2020-12-05 10:00

All, I am trying to get CORS enabled on Tomcat 7.0.52 for Geoserver.

I modified web.xml in conf in tomcat, as specified in http://tomcat.apache.org/tomcat-7.0-doc/co

4条回答
  •  猫巷女王i
    2020-12-05 10:39

    In my case I was using kartoza/geoserver docker image and I had to download the GeoServer war file from the GeoServer website (for the version used in the docker image) and added the geoserver.war file to the directory /usr/local/tomcat/webapps/ and restarted tomcat.

    Only with this configuration above, I managed to enable CORS. Only adding the corsFilter code to web.xml and restarting tomcat, it was resulting in a 404 error when accessing GeoServer. So after adding the war file, the corsFilter code is recognised and it works well.

    I hope this helps someone with a similar error.

提交回复
热议问题