X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/d0e7baf48bf812a5c000c1e8d47a6fb9737d4d87..edfa24c94c1abd9eaac401064e3649c37dbefff2:/cookbooks/stateofthemap/templates/default/apache.jekyll.erb diff --git a/cookbooks/stateofthemap/templates/default/apache.jekyll.erb b/cookbooks/stateofthemap/templates/default/apache.jekyll.erb index 005996b11..55dc39c18 100644 --- a/cookbooks/stateofthemap/templates/default/apache.jekyll.erb +++ b/cookbooks/stateofthemap/templates/default/apache.jekyll.erb @@ -1,46 +1,52 @@ # DO NOT EDIT - This file is being maintained by Chef - ServerName <%= @year %>.stateofthemap.org - ServerAlias <%= @year %>.stateofthemap.com <%= @year %>.sotm.org - ServerAdmin webmaster@openstreetmap.org + ServerName <%= @name %> +<% @aliases.each do |alias_name| -%> + ServerAlias <%= alias_name %> +<% end -%> + ServerAdmin webmaster@openstreetmap.org - CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined - ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log + 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://<%= @year %>.stateofthemap.org/ + RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ + RedirectPermanent / https://<%= @name %>/ +<% unless @aliases.empty? -%> - ServerName <%= @year %>.stateofthemap.com - ServerAlias <%= @year %>.sotm.org - ServerAdmin webmaster@openstreetmap.org + ServerName <%= @aliases.first %> +<% @aliases.drop(1).each do |alias_name| -%> + ServerAlias <%= alias_name %> +<% end -%> + ServerAdmin webmaster@openstreetmap.org - CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined - ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log + CustomLog /var/log/apache2/<%= @name %>-access.log combined + ErrorLog /var/log/apache2/<%= @name %>-error.log - SSLEngine on - SSLCertificateFile /etc/ssl/certs/<%= @year %>.stateofthemap.org.pem - SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key + SSLEngine on + SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem + SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key - RedirectPermanent / https://<%= @year %>.stateofthemap.org/ + RedirectPermanent / https://<%= @name %>/ +<% end -%> - ServerName <%= @year %>.stateofthemap.org - ServerAdmin webmaster@openstreetmap.org + ServerName <%= @name %> + ServerAdmin webmaster@openstreetmap.org - CustomLog /var/log/apache2/<%= @year %>.stateofthemap.org-access.log combined - ErrorLog /var/log/apache2/<%= @year %>.stateofthemap.org-error.log + CustomLog /var/log/apache2/<%= @name %>-access.log combined + ErrorLog /var/log/apache2/<%= @name %>-error.log - SSLEngine on - SSLCertificateFile /etc/ssl/certs/<%= @year %>.stateofthemap.org.pem - SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key + SSLEngine on + SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem + SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key - DocumentRoot /srv/<%= @year %>.stateofthemap.org/_site - + RequestHeader set X-Forwarded-Proto "https" + RequestHeader set X-Forwarded-Port "443" -.stateofthemap.org/_site> - Require all granted - + ProxyPass / http://localhost:<%= @docker_external_port %>/ + ProxyPreserveHost on +