]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/templates/default/apache.backend.erb
Use mod_proxy_fcgi for FCGI support with apache 2.4
[chef.git] / cookbooks / web / templates / default / apache.backend.erb
index e1e65bee45df6afd9397bea4e6158444eb87dc03..336ab56c5ccd5878d9c71d8dcf4d8b754164c2a9 100644 (file)
@@ -36,6 +36,7 @@
   PassengerMinInstances 3
   PassengerMaxRequests 500
   PassengerPreStart http://www.openstreetmap.org/
+  SetEnv SECRET_KEY_BASE <%= @secret_key_base %>
 
   #
   # Get the real remote IP for requests via a trusted proxy
   #
   RewriteRule ^/api/0\.6/map$ - [H=fcgi:127.0.0.1:8000]
   RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$
+<% if node[:lsb][:release].to_f >= 14.04 -%>
+  RewriteRule ^/api/0\.6/(node|way|relation)/[0-9]+$ fcgi://127.0.0.1:8000$0 [P]
+  RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full$ fcgi://127.0.0.1:8000$0 [P]
+  RewriteRule ^/api/0\.6/(nodes|ways|relations)$ fcgi://127.0.0.1:8000$0 [P]
+<% else -%>
   RewriteRule ^/api/0\.6/(node|way|relation)/[0-9]+$ - [H=fcgi:127.0.0.1:8000]
   RewriteRule ^/api/0\.6/(way|relation)/[0-9]+/full$ - [H=fcgi:127.0.0.1:8000]
   RewriteRule ^/api/0\.6/(nodes|ways|relations)$ - [H=fcgi:127.0.0.1:8000]
+<% end -%>
 </VirtualHost>
 <% end -%>