[mapserver-users] (no subject)

Atlanta Geek atlantageek at gmail.com
Tue Sep 28 07:54:26 PDT 2021


When using mapcache to my mapserver I am getting the following error.Access
to

* XMLHttpRequest at
'http://192.168.112.225/mapcache/?SERVICE=WMS&REQUEST=GetCapabilities
<http://192.168.112.225/mapcache/?SERVICE=WMS&REQUEST=GetCapabilities>'
from origin 'http://192.168.115.38 <http://192.168.115.38>' has been
blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains
multiple values '*, *', but only one is allowed.*

I think this is caused by the fact that I have a forwarding rule in my
mapcache.xml




*      <forwarding_rule name="catch all">            <http>
<url>http://192.168.112.225/cgi-bin/mapserv?version=1.1.1&map=/usr/lib/cgi-bin/osm-bw.map
<http://192.168.112.225/cgi-bin/mapserv?version=1.1.1&map=/usr/lib/cgi-bin/osm-bw.map></url>
          </http>*
*      </forwarding_rule>*

and in my apache.conf I have this





*<Directory />        Header add Access-Control-Allow-Origin "*"
Options FollowSymLinks        AllowOverride None        Require all denied*
*</Directory>--*

So one of the Access-Control-Allow-Origin  comes from the apache server for
the GetCapabilities call and then another is added because the
forwarding_rule adds the header as well.

What is a good way to get around this.  I tried to just add the
access-Control-Allow-Origin rule on the mapcache path but it did not work.


http://www.atlantageek.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210928/443ef917/attachment.html>


More information about the MapServer-users mailing list