- # Define a load balancer for the local backends
- #
- <Proxy balancer://backend>
- ProxySet lbmethod=bybusyness
-<% node[:web][:backends].each do |backend| -%>
-<% if port == 443 -%>
- BalancerMember https://<%= backend %> disablereuse=on
-<% else -%>
- BalancerMember http://<%= backend %>
-<% end -%>
-<% end -%>
- </Proxy>
-
- #
- # Define a load balancer for the IC backends
- #
- <Proxy balancer://ic>
- ProxySet lbmethod=bybusyness
-<% ["rails1.ic", "rails2.ic", "rails3.ic"].each do |backend| -%>
-<% if port == 443 -%>
- BalancerMember https://<%= backend %> disablereuse=on
-<% else -%>
- BalancerMember http://<%= backend %>
-<% end -%>
-<% end -%>
- </Proxy>
-<% if port == 80 -%>
-
- #
- # Redirect requests which should be secure to https
- #
- RewriteCond %{REQUEST_URI} ^/login(\.html)?$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/(new|create-account\.html)$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/terms$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/save$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/([^/]+)/account$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/reset-password$
- RewriteRule ^(.*)$ https://www.openstreetmap.org$1 [L,NE,R=permanent]
-
- #
- # Redirect api requests made to www.osm.org to api.osm.org
- #
-# RewriteCond %{HTTP_HOST} =www.openstreetmap.org
-# RewriteRule ^/api/(.*)$ http://api.openstreetmap.org/api/$1 [L,NE,R=permanent]
-
- #
- # Redirect non-api requests made to api.osm.org to www.osm.org
- #
- RewriteCond %{HTTP_HOST} =api.openstreetmap.org
- RewriteCond %{REQUEST_URI} !^/api/
- RewriteRule ^(.*)$ http://www.openstreetmap.org$1 [L,NE,R=permanent]
-<% elsif port == 443 -%>
-
- #
- # Redirect api requests made to www.osm.org to api.osm.org