<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi,</p>
<p>I am running mapproxy as a WSGI app behind an Apache web server.</p>
<p>Apache is configured to allow CORS access by setting the </p>
<p>Access-Control-Allow-Origin header: *</p>
<p>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.</p>
<p><img src="cid:372a530914c1220d4f9d97a00f5e5f6f@carto.net" /></p>
<p>Complaint from browser:</p>
<p><img src="cid:06aec5578946150dcd483fa5510f8c9c@carto.net" /></p>
<p>Now, after reading the documentation from Mapproxy (see <a href="https://mapproxy.org/docs/1.11.0/configuration.html#access-control-allow-origin">https://mapproxy.org/docs/1.11.0/configuration.html#access-control-allow-origin</a>), I set the following globals in my config.yaml:</p>
<p>----------------</p>
<pre>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:
</pre>
<div id="signature">--------------</div>
<div> </div>
<div>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?</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>Thanks a lot and greetings,</div>
<div>Andreas </div>
</body></html>