]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tile/templates/default/apache.erb
1ffa2323d278997acb302431563a25d17f096168
[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   # Enable the rewrite engine
28   RewriteEngine on
29
30   # Rewrite tile requests to the default style
31   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png$ /default/$1/$2/$3.png [PT,T=image/png,L]
32   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/status/?$  /default/$1/$2/$3.png/status [PT,T=text/plain,L]
33   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/dirty/?$   /default/$1/$2/$3.png/dirty  [PT,T=text/plain,L]
34 </VirtualHost>
35
36 <Directory /srv/tile.openstreetmap.org/html>
37   Options None
38   AllowOverride None
39   Order allow,deny
40   Allow from all
41 </Directory>
42
43 <Directory /srv/tile.openstreetmap.org/cgi-bin>
44   Options ExecCGI
45   AllowOverride None
46   Order allow,deny
47   Allow from all
48 </Directory>