[MapProxy] Trouble with double CORS header

Andreas Neumann a.neumann at carto.net
Tue Mar 12 00:00:30 PDT 2019


Hi, 

I am running mapproxy as a WSGI app behind an Apache web server. 

Apache is configured to allow CORS access by setting the  

Access-Control-Allow-Origin header: * 

Now the trouble is: mapproxy also sets this header and both Firefox and
Google Chrome refuse to load such WMTS if it comes from another domain.
They complain about the double header. 

Complaint from browser: 

Now, after reading the documentation from Mapproxy (see
https://mapproxy.org/docs/1.11.0/configuration.html#access-control-allow-origin),
I set the following globals in my config.yaml: 

----------------

globals:
    image:
        resampling_method: bicubic
        # stretch cached images by this factor before using the next
level
        stretch_factor: 1.15
        # shrink cached images up to this factor before returning an
empty image (for the first level)
        max_shrink_factor: 4.0
        formats:
          image/jpeg:
            encoding_options:
              jpeg_quality: 75
          image/png:
              transparent: true
    srs:
        proj_data_dir: /usr/local/share/proj
    http:
        #disable here (leave empty), because Apache/NGINX is handling
CORS
        access_control_allow_origin:

-------------- 

The problem: it has no effect. The double CORS header stays like it was
before. Any idea how I can get Mapproxy to suppress this additional
header? 

I can't disable the CORS header on Apache, since other services on the
same machine next to mapproxy also require this header. So I need to
disable it in mapproxy. 

Thanks a lot and greetings, 
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20190312/6f2ee97a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 372a5309.png
Type: image/png
Size: 46553 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20190312/6f2ee97a/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 06aec557.png
Type: image/png
Size: 18756 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20190312/6f2ee97a/attachment-0003.png>


More information about the MapProxy mailing list