]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/templates/default/apache.frontend.erb
Bring web site back online using karm
[chef.git] / cookbooks / web / templates / default / apache.frontend.erb
index 717d3f69b6156d7a8440e5675540dddc8b02a380..39117f4dc926a8b4319c4e8afe4d6ae455e73b87 100644 (file)
@@ -6,7 +6,7 @@
   # Basic server configuration
   #
   ServerName <%= node[:fqdn] %>
   # Basic server configuration
   #
   ServerName <%= node[:fqdn] %>
-  ServerAlias api.openstreetmap.org www.openstreetmap.org
+  ServerAlias api.openstreetmap.org www.openstreetmap.org 127.0.0.1
   ServerAdmin webmaster@openstreetmap.org
 <% if port == 443 -%>
 
   ServerAdmin webmaster@openstreetmap.org
 <% if port == 443 -%>
 
@@ -15,6 +15,8 @@
   #
   SSLEngine on
   SSLProxyEngine on
   #
   SSLEngine on
   SSLProxyEngine on
+  SSLCertificateFile /etc/ssl/certs/www.openstreetmap.org.pem
+  SSLCertificateKeyFile /etc/ssl/private/www.openstreetmap.org.key
 <% end -%>
 
   #
 <% end -%>
 
   #
@@ -56,7 +58,7 @@
   # Block changeset scraper
   #
   RewriteCond %{HTTP_USER_AGENT} "OSMApp Tuner"
   # Block changeset scraper
   #
   RewriteCond %{HTTP_USER_AGENT} "OSMApp Tuner"
-  RewriteRule . - [F,L]  
+  RewriteRule . - [F,L]
 
   #
   # Block requests for the old 404 map tile
 
   #
   # Block requests for the old 404 map tile
   ProxyPass /api/0.6/amf/read balancer://backend/api/0.6/amf/read
   ProxyPass /api/0.6/swf/trackpoints balancer://backend/api/0.6/swf/trackpoints
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+)$ balancer://backend$1
   ProxyPass /api/0.6/amf/read balancer://backend/api/0.6/amf/read
   ProxyPass /api/0.6/swf/trackpoints balancer://backend/api/0.6/swf/trackpoints
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+)$ balancer://backend$1
-  ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/upload)$ balancer://bytemark$1
+  ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/upload)$ balancer://ic$1
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/download)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+/(full|history|search|ways))$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/changeset/[0-9]+/download)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+)$ balancer://backend$1
   ProxyPassMatch ^(/api/0\.6/(node|way|relation)/[0-9]+/(full|history|search|ways))$ balancer://backend$1
   ProxyPass /api/0.6/relations balancer://backend/api/0.6/relations
   ProxyPassMatch ^(/trace/[0-9]+/data(|/|.xml))$ balancer://backend$1
 
   ProxyPass /api/0.6/relations balancer://backend/api/0.6/relations
   ProxyPassMatch ^(/trace/[0-9]+/data(|/|.xml))$ balancer://backend$1
 
+  #
+  # Redirect ACME certificate challenges
+  #
+  RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+
   #
   # Redirect trac and wiki requests to the right places
   #
   #
   # Redirect trac and wiki requests to the right places
   #
   </Proxy>
 
   #
   </Proxy>
 
   #
-  # Define a load balancer for the Bytemark backends
+  # Define a load balancer for the IC backends
   #
   #
-  <Proxy balancer://bytemark>
+  <Proxy balancer://ic>
     ProxySet lbmethod=bybusyness
     ProxySet lbmethod=bybusyness
-<% ["rails4.bm", "rails5.bm"].each do |backend| -%>
+<% ["rails1.bm", "rails2.bm", "rails3.bm"].each do |backend| -%>
 <% if port == 443 -%>
     BalancerMember https://<%= backend %> disablereuse=on
 <% else -%>
 <% if port == 443 -%>
     BalancerMember https://<%= backend %> disablereuse=on
 <% else -%>
   ServerAlias *
 
   SSLEngine on
   ServerAlias *
 
   SSLEngine on
+  SSLCertificateFile /etc/ssl/certs/www.openstreetmap.org.pem
+  SSLCertificateKeyFile /etc/ssl/private/www.openstreetmap.org.key
 
   RedirectPermanent / https://www.openstreetmap.org/
 </VirtualHost>
 
   RedirectPermanent / https://www.openstreetmap.org/
 </VirtualHost>