Based on various behaviors I have seen, it would seem that mod_tile completely controls the response headers. All my attempts to add CORS headers (or any test custom headers at all) to various apache .conf files are ignored for tiles, but not other random test pages.

Looking at the mod_tile source, I see in mod_tile.c, code like:

/**
 * Add CORS ( Cross-origin resource sharing ) headers. http://www.w3.org/TR/cors/
 * CORS allows requests that would otherwise be forbidden under the same origin policy.
 */
static int add_cors(request_rec *r, const char * cors) {

which would seem to confirm that a mod_tile oriented solution is the correct path.

However, I am not sure how to actually accomplish that. Attempting to add CORS=* at various points in /usr/local/etc/renderd.conf has no effect.

Does anyone understand this source code and how to get it to add CORS related headers?

It would seem that mod_tile will potentially do a lot of useful logging…does anyone know how to turn on debug logging for it?

Thank you.