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 "%a %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
 
  39   PassengerPreStart https://www.openstreetmap.org/
 
  41   PassengerPreStart http://www.openstreetmap.org/
 
  43   SetEnv SECRET_KEY_BASE <%= @secret_key_base %>
 
  46   # Get the real remote IP for requests via a trusted proxy
 
  48   RemoteIPHeader X-Forwarded-For
 
  49   RemoteIPTrustedProxy 146.179.159.160/27
 
  52   # Pass supported calls to cgimap
 
  54   RewriteRule ^/api/0\.6/map$ fcgi://127.0.0.1:8000$0 [P]
 
  55   RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$
 
  56   RewriteRule ^/api/0\.6/(node|way|relation)/[0-9]+$ fcgi://127.0.0.1:8000$0 [P]
 
  57   RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full$ fcgi://127.0.0.1:8000$0 [P]
 
  58   RewriteRule ^/api/0\.6/(nodes|ways|relations)$ fcgi://127.0.0.1:8000$0 [P]
 
  62 <Directory <%= node[:web][:base_directory] %>/rails/public>