summaryrefslogtreecommitdiff
path: root/templates/site.erb
diff options
context:
space:
mode:
Diffstat (limited to 'templates/site.erb')
-rw-r--r--templates/site.erb12
1 files changed, 12 insertions, 0 deletions
diff --git a/templates/site.erb b/templates/site.erb
index 2ed5107..17ff13e 100644
--- a/templates/site.erb
+++ b/templates/site.erb
@@ -38,6 +38,18 @@
AllowOverride <%= @allow_override %>
</Directory>
<% end -%>
+<% if @certbot != false -%>
+ # Add Alias For Lets Encrypt WebRoot Authentication Using ACME
+ # See https://ubuntu101.co.za/ssl/postfix-and-dovecot-on-ubuntu-with-a-lets-encrypt-ssl-certificate/
+ AliasMatch ^/.well-known/acme-challenge/(.*)$ /var/spool/certbot/<%= @name %>/.well-known/acme-challenge/$1
+ Alias /.well-known/acme-challenge/ /var/spool/certbot/<%= @name %>/.well-known/acme-challenge/
+ <Directory "/var/spool/certbot/<%= @name %>/.well-known/acme-challenge/">
+ Options None
+ AllowOverride None
+ ForceType text/plain
+ RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
+ </Directory>
+<% end -%>
</VirtualHost>
# end vhost for <%= @title %>
<% if @ssl == true %>