]> git.openstreetmap.org Git - chef.git/blob - cookbooks/web/templates/default/apache.backend.erb
Ignore errors killing processes which may have already exited
[chef.git] / cookbooks / web / templates / default / apache.backend.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2 <% [80, 443].each do |port| -%>
3
4 <VirtualHost *:<%= port %>>
5   #
6   # Basic server configuration
7   #
8   ServerName <%= node[:fqdn] %>
9   ServerAlias api.openstreetmap.org www.openstreetmap.org
10   ServerAdmin webmaster@openstreetmap.org
11 <% if port == 443 -%>
12
13   #
14   # Enable SSL
15   #
16   SSLEngine on
17 <% end -%>
18
19   #
20   # Setup logging
21   #
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
25
26   #
27   # Turn on the rewrite engine
28   #
29   RewriteEngine on
30
31   #
32   # Configure rails
33   #
34   DocumentRoot <%= node[:web][:base_directory] %>/rails/public
35   RailsEnv production
36   PassengerMinInstances 3
37   PassengerMaxRequests 500
38   PassengerPreStart http://www.openstreetmap.org/
39
40   #
41   # Get the real remote IP for requests via a trusted proxy
42   #
43   RemoteIPHeader X-Forwarded-For
44   RemoteIPTrustedProxy 146.179.159.160/27
45
46   #
47   # Pass supported calls to cgimap
48   #
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]
54 </VirtualHost>
55 <% end -%>