Hello, I enabled CORS in GeoServer by running the container in the following way:
docker run -it --name geoserverivrea --network ivreanetwork -p8081:8080 -d --mount type=bind,src=/home/kilsedar/geoserver_data,target=/opt/geoserver_data --env INSTALL_EXTENSIONS=true --env STABLE_EXTENSIONS="ysld,ogcapi-features,wps" --env CORS_ENABLED=true
docker.osgeo.org/geoserver:2.27.1I fact thanks to this, outside the container, I can get vector features, from a web application served by an Apache server. For example "
http://localhost:8081/geoserver/ows?typeName=topp%3Astates&version=1.1.0&service=WFS&acceptversions=2.0.0&request=GetFeature&outputFormat=application%2Fjson&srsname=EPSG%3A3857" works from inside a web application.
However, inside the MapServer container, I keep getting CORS errors, such as:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
http://geoserverivrea:8080/geoserver/ows?typeName=ne%3Acountries&version=1.1.0&service=WFS&acceptversions=2.0.0&request=GetFeature&outputFormat=application%2Fjson&srsname=EPSG%3A3857. (Reason: CORS request did not succeed). Status code: (null).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
http://geoserverivrea:8080/geoserver/wps?service=WFS&version=1.0.0&REQUEST=DescribeProcess&IDENTIFIER=gs%3APagedUnique&acceptversions=2.0.0&request=GetCapabilities. (Reason: CORS request did not succeed). Status code: (null).
In the /usr/local/tomcat/webapps/mapstore/configs/localConfig.json of MapStore container I put, in "useCORS", both "
http://geoserverivrea:8080/geoserver" and "
http://localhost:8081/geoserver", but this didn't have any effect.
Do you have any idea what I may be doing wrong? Thank you very much!