]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tile/templates/default/apache.erb
Update carto stylesheet to v2.45.0
[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   LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_with_remoteip
26   CustomLog /var/log/apache2/access.log combined_with_remoteip
27   ErrorLog /var/log/apache2/error.log
28   BufferedLogs on
29
30   # Always set Access-Control-Allow-Origin so that simple CORS requests
31   # will always work and can be cached
32   Header set Access-Control-Allow-Origin "*"
33
34   # Remove Proxy request header to mitigate https://httpoxy.org/
35   RequestHeader unset Proxy early
36
37   # Enable the rewrite engine
38   RewriteEngine on
39
40   # Rewrite tile requests to the default style
41   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png$ /default/$1/$2/$3.png [PT,T=image/png,L]
42   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/status/?$  /default/$1/$2/$3.png/status [PT,T=text/plain,L]
43   RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/dirty/?$   /default/$1/$2/$3.png/dirty  [PT,T=text/plain,L]
44
45   # Historical Files redirect
46   Redirect /processed_p.tar.bz2 http://planet.openstreetmap.org/historical-shapefiles/processed_p.tar.bz2
47   Redirect /shoreline_300.tar.bz2 http://planet.openstreetmap.org/historical-shapefiles/shoreline_300.tar.bz2
48   Redirect /world_boundaries-spherical.tgz http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz
49 </VirtualHost>
50
51 <Directory /srv/tile.openstreetmap.org/html>
52   Options None
53   AllowOverride None
54   Require all granted
55 </Directory>
56
57 <Directory /srv/tile.openstreetmap.org/cgi-bin>
58   Options ExecCGI
59   AllowOverride None
60   Require all granted
61 </Directory>
62
63 <Location /cgi-bin/export>
64   <RequireAll>
65     Require all granted
66     Require not ip 60.199.131.39
67     Require not ip 92.217.67.26
68     Require not ip 103.53.208.109
69     Require not ip 113.196.123.178
70     Require not ip 118.193.51.194
71     Require not ip 119.188.70.34
72     Require not ip 165.228.125.15
73     Require not ip 171.13.14.152
74     Require not ip 171.15.132.56
75     Require not ip 199.203.108.5
76     Require not ip 210.209.89.127
77     Require not ip 210.65.88.6
78   </RequireAll>
79 </Location>