]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/foundation/templates/default/apache.welcome.erb
Add docker based welcome.openstreetmap.org
[chef.git] / cookbooks / foundation / templates / default / apache.welcome.erb
diff --git a/cookbooks/foundation/templates/default/apache.welcome.erb b/cookbooks/foundation/templates/default/apache.welcome.erb
new file mode 100644 (file)
index 0000000..581fb4e
--- /dev/null
@@ -0,0 +1,38 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+<VirtualHost *:443>
+   ServerName <%= @name %>
+<% @aliases.each do |alias_name| -%>
+   ServerAlias <%= alias_name %>
+<% end -%>
+   ServerAdmin webmaster@openstreetmap.org
+
+   CustomLog /var/log/apache2/<%= @name %>-access.log combined
+   ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+   SSLEngine on
+   SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem
+   SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key
+
+   # Let the backend know we are using HTTPS
+   RequestHeader set X-Forwarded-Proto “https”
+   RequestHeader set X-Forwarded-Port “443”
+
+   ProxyPass / http://localhost:<%= @docker_external_port %>/
+   ProxyPreserveHost on
+
+</VirtualHost>
+
+<VirtualHost *:80>
+   ServerName <%= @name %>
+<% @aliases.each do |alias_name| -%>
+   ServerAlias <%= alias_name %>
+<% end -%>
+   ServerAdmin webmaster@openstreetmap.org
+
+   CustomLog /var/log/apache2/<%= @name %>-access.log combined
+   ErrorLog /var/log/apache2/<%= @name %>-error.log
+
+   RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
+   RedirectPermanent / https://<%= @name %>/
+</VirtualHost>