mapserver-docker
mapserver-docker copied to clipboard
How to enable CORS?
How to enable CORS? It says Access to image at 'http://localhost:8182/mapserv.exe?map=/map/21.map&mode=map&layers=all&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=ind_provinces&CRS=EPSG%3A3857&STYLES=&WIDTH=1561&HEIGHT=668&BBOX=10816145.25046558%2C-144771.73157212383%2C11770079.363464583%2C263401.9994707174' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Quite old but if anybody ends up here, then add add_header 'Access-Control-Allow-Origin' '*';
to nginx configuration.