source: subversion/applications/utils/mod_tile/renderd.conf @ 29196

Last change on this file since 29196 was 28922, checked in by apmon, 7 years ago

[mod_tile] Add support for CORS ( Cross-origin resource sharing )

XMLHttpRequest as used for example in KothicJS to display json vector tiles can by default
request tiles from the same origin. So for example if the KothicJS page is loaded from
http://toolserver.org/ but mod_tile serving the json tiles are hosted on http://a.www.toolserver.org
the browser can not access the tiles with out cross-origin resource sharing.

This patch adds support for cors to allow this kind of usage.
Tile layers configured via AddTileMimeConfig? in the apache site config with a mimetype of JS
automatically have the CORS policy set to Access-Control-Allow-Origin: *

It is also possible to explicitly set the cors policy for all types of layers if they are configured
via mod_tile.conf/renderd.conf. Here the CORS parameter in the tile layer section allows to
specify it.

File size: 1.5 KB
Line 
1[renderd]
2;socketname=/var/run/renderd/renderd.sock
3num_threads=4
4tile_dir=/var/lib/mod_tile ; DOES NOT WORK YET
5stats_file=/var/run/renderd/renderd.stats
6
7[mapnik]
8plugins_dir=/usr/local/lib64/mapnik/input
9font_dir=/usr/local/lib64/mapnik/fonts
10font_dir_recurse=1
11
12[default]
13URI=/osm_tiles/
14XML=/home/jburgess/osm/svn.openstreetmap.org/applications/rendering/mapnik/osm-local.xml
15HOST=tile.openstreetmap.org
16;HTCPHOST=proxy.openstreetmap.org
17;** config options used by mod_tile, but not renderd **
18;MINZOOM=0
19;MAXZOOM=18
20;TYPE=png image/png
21;DESCRIPTION=This is a description of the tile layer used in the tile json request
22;ATTRIBUTION=&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/wiki/Contributors\">contributors</a>, <a href=\"http://opendatacommons.org/licenses/odbl/\">ODbL</a>
23;SERVER_ALIAS=http://localhost/
24;CORS=http://www.openstreetmap.org
25
26;[style2]
27;URI=/osm_tiles2/
28;XML=/home/jburgess/osm/svn.openstreetmap.org/applications/rendering/mapnik/osm-local2.xml
29;HOST=tile.openstreetmap.org
30;HTCPHOST=proxy.openstreetmap.org
31;** config options used by mod_tile, but not renderd **
32;MINZOOM=0
33;MAXZOOM=22
34;TYPE=png image/png
35;DESCRIPTION=This is a description of the tile layer used in the tile json request
36;ATTRIBUTION=&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/wiki/Contributors\">contributors</a>, <a href=\"http://opendatacommons.org/licenses/odbl/\">ODbL</a>
37;SERVER_ALIAS=http://localhost/
38;CORS=*
39
Note: See TracBrowser for help on using the repository browser.