4

I installed recent MapProxy (1.7.1) on Ubuntu 14.04 LTS following this guide. Everything works - I can get test OSM layer's tiles through proxy. But in order to use this layer on my web page I have to add additional response header:

Access-Control-Allow-Origin: http://my-domain

If found headers option in the documentation but it's meant to

add additional HTTP headers to all requests to your sources

but not response headers of proxy itself.

So my question is: how can I add additional HTTP headers to my MapProxy's responses?

1 Answer 1

1

Some time ago I opened an issue on github.com, and now one should be able to configure Access-Control-Allow-Origin header using access_control_allow_origin option in globals.http section. This one is available since 1.8.0 (in nightly builds at the moment I answer this question). Thanks to MapProxy's developers.

Another way proposed in the comment is to use additional dedicated HTTP proxy or any other HTTP server with proxy capabilities (like Apache with mod_proxy) in front of MapProxy with desired configuration of response headers. See Deployment - HTTP proxy section in the docs for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.