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