[MapProxy] Trouble with double CORS header

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[MapProxy] Trouble with double CORS header

Andreas Neumann-4

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 

_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy