X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/246de2442c7b3d8772a0ed6cfd0859f2ba5d281a..0d8030b3a7ec9eaa6bc96c7dd39d835a00a7ace0:/cookbooks/tile/templates/default/apache.erb?ds=sidebyside diff --git a/cookbooks/tile/templates/default/apache.erb b/cookbooks/tile/templates/default/apache.erb index f2e52cfe6..8df11453b 100644 --- a/cookbooks/tile/templates/default/apache.erb +++ b/cookbooks/tile/templates/default/apache.erb @@ -2,7 +2,7 @@ # Basic server configuration - ServerName <%= node[:fqdn] %> + ServerName <%= node.name %> ServerAlias tile.openstreetmap.org ServerAlias render.openstreetmap.org ServerAdmin webmaster@openstreetmap.org @@ -12,8 +12,8 @@ # SSLEngine on SSLProxyEngine on - SSLCertificateFile /etc/ssl/certs/<%= node[:fqdn] %>.pem - SSLCertificateKeyFile /etc/ssl/private/<%= node[:fqdn] %>.key + SSLCertificateFile /etc/ssl/certs/<%= node.name %>.pem + SSLCertificateKeyFile /etc/ssl/private/<%= node.name %>.key # Configure location of static files and CGI scripts DocumentRoot /srv/tile.openstreetmap.org/html @@ -37,6 +37,9 @@ # will always work and can be cached Header set Access-Control-Allow-Origin "*" + # Add diagnostics header to identify render server + Header set X-TileRender "<%= node.name %>" + # Remove Proxy request header to mitigate https://httpoxy.org/ RequestHeader unset Proxy early @@ -44,9 +47,9 @@ RewriteEngine on # Rewrite tile requests to the default style - RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png$ /default/$1/$2/$3.png [PT,T=image/png,L] - RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/status/?$ /default/$1/$2/$3.png/status [PT,T=text/plain,L] - RewriteRule ^/(-?\d+)/(-?\d+)/(-?\d+)\.png/dirty/?$ /default/$1/$2/$3.png/dirty [PT,T=text/plain,L] + RewriteRule ^/(\d+)/(\d+)/(\d+)\.png$ /default/$1/$2/$3.png [PT,T=image/png,L] + RewriteRule ^/(\d+)/(\d+)/(\d+)\.png/status/?$ /default/$1/$2/$3.png/status [PT,T=text/plain,L] + RewriteRule ^/(\d+)/(\d+)/(\d+)\.png/dirty/?$ /default/$1/$2/$3.png/dirty [PT,T=text/plain,L] # Historical Files redirect RedirectPermanent /processed_p.tar.bz2 https://planet.openstreetmap.org/historical-shapefiles/processed_p.tar.bz2 @@ -59,7 +62,7 @@ # Basic server configuration - ServerName <%= node[:fqdn] %> + ServerName <%= node.name %> ServerAlias tile.openstreetmap.org ServerAlias render.openstreetmap.org ServerAdmin webmaster@openstreetmap.org @@ -82,6 +85,9 @@ # will always work and can be cached Header set Access-Control-Allow-Origin "*" + # Add diagnostics header to identify render server + Header set X-TileRender "<%= node.name %>" + # Remove Proxy request header to mitigate https://httpoxy.org/ RequestHeader unset Proxy early @@ -93,6 +99,7 @@ # Redirect to https RewriteCond %{REQUEST_URI} !^/server-status$ + RewriteCond %{REQUEST_URI} !^/mod_tile$ RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=permanent,L]