1 # DO NOT EDIT - This file is being maintained by Chef
4 # Basic server configuration
5 ServerName <%= node.name %>
6 ServerAlias tile.openstreetmap.org
7 ServerAlias render.openstreetmap.org
8 ServerAdmin webmaster@openstreetmap.org
15 SSLCertificateFile /etc/ssl/certs/<%= node.name %>.pem
16 SSLCertificateKeyFile /etc/ssl/private/<%= node.name %>.key
18 # Configure location of static files and CGI scripts
19 DocumentRoot /srv/tile.openstreetmap.org/html
20 ScriptAlias /cgi-bin/ /srv/tile.openstreetmap.org/cgi-bin/
22 # Get the real remote IP for requests via a trusted proxy
23 RemoteIPHeader X-Forwarded-For
24 <% @caches.each do |cache| -%>
25 <% cache.ipaddresses(:role => :external).sort.each do |address| -%>
26 RemoteIPTrustedProxy <%= address %>
31 LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_with_remoteip
32 CustomLog /var/log/apache2/access.log combined_with_remoteip
33 ErrorLog /var/log/apache2/error.log
36 # Always set Access-Control-Allow-Origin so that simple CORS requests
37 # will always work and can be cached
38 Header set Access-Control-Allow-Origin "*"
40 # Add diagnostics header to identify render server
41 Header set X-TileRender "<%= node.name %>"
43 # Remove Proxy request header to mitigate https://httpoxy.org/
44 RequestHeader unset Proxy early
46 # Enable the rewrite engine
49 # Rewrite tile requests to the default style
50 RewriteRule ^/(\d+)/(\d+)/(\d+)\.png$ /default/$1/$2/$3.png [PT,T=image/png,L]
51 RewriteRule ^/(\d+)/(\d+)/(\d+)\.png/status/?$ /default/$1/$2/$3.png/status [PT,T=text/plain,L]
52 RewriteRule ^/(\d+)/(\d+)/(\d+)\.png/dirty/?$ /default/$1/$2/$3.png/dirty [PT,T=text/plain,L]
54 # Historical Files redirect
55 RedirectPermanent /processed_p.tar.bz2 https://planet.openstreetmap.org/historical-shapefiles/processed_p.tar.bz2
56 RedirectPermanent /shoreline_300.tar.bz2 https://planet.openstreetmap.org/historical-shapefiles/shoreline_300.tar.bz2
57 RedirectPermanent /world_boundaries-spherical.tgz https://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz
59 # Redirect ACME certificate challenges
60 RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
64 # Basic server configuration
65 ServerName <%= node.name %>
66 ServerAlias tile.openstreetmap.org
67 ServerAlias render.openstreetmap.org
68 ServerAdmin webmaster@openstreetmap.org
70 # Get the real remote IP for requests via a trusted proxy
71 RemoteIPHeader X-Forwarded-For
72 <% @caches.each do |cache| -%>
73 <% cache.ipaddresses(:role => :external).sort.each do |address| -%>
74 RemoteIPTrustedProxy <%= address %>
79 LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_with_remoteip
80 CustomLog /var/log/apache2/access.log combined_with_remoteip
81 ErrorLog /var/log/apache2/error.log
84 # Always set Access-Control-Allow-Origin so that simple CORS requests
85 # will always work and can be cached
86 Header set Access-Control-Allow-Origin "*"
88 # Add diagnostics header to identify render server
89 Header set X-TileRender "<%= node.name %>"
91 # Remove Proxy request header to mitigate https://httpoxy.org/
92 RequestHeader unset Proxy early
94 # Enable the rewrite engine
97 # Redirect ACME certificate challenges
98 RewriteRule ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 [R=permanent,L]
101 RewriteCond %{REQUEST_URI} !^/server-status$
102 RewriteCond %{REQUEST_URI} !^/mod_tile$
103 RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=permanent,L]
106 <Directory /srv/tile.openstreetmap.org/html>
112 <Directory /srv/tile.openstreetmap.org/cgi-bin>