1 # DO NOT EDIT - This file is being maintained by Chef
 
   2 <% [80, 443].each do |port| -%>
 
   4 <VirtualHost *:<%= port %>>
 
   6   # Basic server configuration
 
   8   ServerName <%= node[:fqdn] %>
 
   9   ServerAlias api.openstreetmap.org www.openstreetmap.org
 
  10   ServerAdmin webmaster@openstreetmap.org
 
  22   LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %Ts" combined_with_time
 
  23   CustomLog /var/log/apache2/access.log combined_with_time
 
  24   ErrorLog /var/log/apache2/error.log
 
  27   # Turn on the rewrite engine
 
  34   DocumentRoot <%= node[:web][:base_directory] %>/rails/public
 
  36   PassengerMinInstances 3
 
  37   PassengerMaxRequests 500
 
  38   PassengerPreStart http://www.openstreetmap.org/
 
  41   # Get the real remote IP for requests via a trusted proxy
 
  43   RemoteIPHeader X-Forwarded-For
 
  44   RemoteIPTrustedProxy 146.179.159.160/27
 
  47   # Pass supported calls to cgimap
 
  49   RewriteRule ^/api/0\.6/map$ - [H=fcgi:127.0.0.1:8000]
 
  50   RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$
 
  51   RewriteRule ^/api/0\.6/(node|way|relation)/[0-9]+$ - [H=fcgi:127.0.0.1:8000]
 
  52   RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full$ - [H=fcgi:127.0.0.1:8000]
 
  53   RewriteRule ^/api/0\.6/(nodes|ways|relations)$ - [H=fcgi:127.0.0.1:8000]