]> git.openstreetmap.org Git - chef.git/blob - cookbooks/web/templates/default/apache.backend.erb
Keep /relation/N/full with rails for now
[chef.git] / cookbooks / web / templates / default / apache.backend.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <VirtualHost *:80>
4   #
5   # Basic server configuration
6   #
7   ServerName <%= node[:fqdn] %>
8   ServerAlias api.openstreetmap.org www.openstreetmap.org
9   ServerAdmin webmaster@openstreetmap.org
10
11   #
12   # Setup logging
13   #
14   LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %Ts" combined_with_time
15   CustomLog /var/log/apache2/access.log combined_with_time
16   ErrorLog /var/log/apache2/error.log
17
18   #
19   # Turn on the rewrite engine
20   #
21   RewriteEngine on
22
23   #
24   # Configure rails
25   #
26   DocumentRoot <%= node[:web][:base_directory] %>/rails/public
27   RailsEnv production
28   PassengerMinInstances 3
29   PassengerMaxRequests 500
30   PassengerPreStart http://www.openstreetmap.org/
31
32   #
33   # Get the real remote IP for requests via a trusted proxy
34   #
35   RemoteIPHeader X-Forwarded-For
36   RemoteIPTrustedProxy 146.179.159.160/27
37
38   #
39   # Pass supported calls to cgimap
40   #
41   RewriteRule ^/api/0\.6/map$ - [H=fcgi:127.0.0.1:8000]
42   RewriteRule ^/api/0\.6/(way)/[0-9]+/full$ - [H=fcgi:127.0.0.1:8000]
43   RewriteRule ^/api/0\.6/(nodes|ways|relations)$ - [H=fcgi:127.0.0.1:8000]
44 </VirtualHost>