]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tile/templates/default/apache.erb
Switch remaining caches to use render.openstreetmap.org
[chef.git] / cookbooks / tile / templates / default / apache.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <VirtualHost *:80>
4   # Basic server configuration
5   ServerName <%= node[:fqdn] %>
6   ServerAlias tile.openstreetmap.org
7   ServerAlias parent.tile.openstreetmap.org
8   ServerAdmin webmaster@openstreetmap.org
9
10   # Configure location of static files and CGI scripts
11   DocumentRoot /srv/tile.openstreetmap.org/html
12   ScriptAlias /cgi-bin/ /srv/tile.openstreetmap.org/cgi-bin/
13
14   # Get the real remote IP for requests via a trusted proxy
15   RemoteIPHeader X-Forwarded-For
16 <% @caches.each do |cache| -%>
17 <% cache.ipaddresses(:role => :external).sort.each do |address| -%>
18   RemoteIPTrustedProxy <%= address %>
19 <% end -%>
20 <% end -%>
21
22   # Setup logging
23   CustomLog /var/log/apache2/access.log combined
24   ErrorLog /var/log/apache2/error.log
25   BufferedLogs on
26
27   #Set Access-Control-Allow-Origin header to allow Cross-origin resource sharing (CORS)
28   Header set Access-Control-Allow-Origin "*"
29
30   # Enable the rewrite engine
31   RewriteEngine on
32
33   # Rewrite tile requests to the default style
34   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png$ /default/$1/$2/$3.png [PT,T=image/png,L]
35   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/status/?$  /default/$1/$2/$3.png/status [PT,T=text/plain,L]
36   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/dirty/?$   /default/$1/$2/$3.png/dirty  [PT,T=text/plain,L]
37
38   # Historical Files redirect
39   Redirect /processed_p.tar.bz2 http://planet.openstreetmap.org/historical-shapefiles/processed_p.tar.bz2
40   Redirect /shoreline_300.tar.bz2 http://planet.openstreetmap.org/historical-shapefiles/shoreline_300.tar.bz2
41   Redirect /world_boundaries-spherical.tgz http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz
42
43 </VirtualHost>
44
45 <Directory /srv/tile.openstreetmap.org/html>
46   Options None
47   AllowOverride None
48   Order allow,deny
49   Allow from all
50 </Directory>
51
52 <Directory /srv/tile.openstreetmap.org/cgi-bin>
53   Options ExecCGI
54   AllowOverride None
55   Order allow,deny
56   Allow from all
57 </Directory>