<VirtualHost *:80>
	ServerAdmin webmaster@minmaxiste.com
	ServerName <%= @name %>

	DocumentRoot <%= @docroot %>
	RedirectMatch permanent "^(?!/.well-known/acme-challenge/.*)" https://<%= @name %>/$1

	ErrorLog ${APACHE_LOG_DIR}/<%= @name %>/error.log
	CustomLog ${APACHE_LOG_DIR}/<%= @name %>/access.log combined
</VirtualHost>

<VirtualHost *:442>
	ServerAdmin webmaster@minmaxiste.com
	ServerName <%= @name %>

	DocumentRoot <%= @docroot %>
	DirectoryIndex index.html

	ErrorLog ${APACHE_LOG_DIR}/<%= @name %>/error.log
	CustomLog ${APACHE_LOG_DIR}/<%= @name %>/access.log combined

	RemoteIPProxyProtocol On

	SSLEngine on
	SSLCertificateFile      /etc/ssl/certs/<%= @fqdn %>.pem
	SSLCertificateKeyFile   /etc/ssl/private/<%= @fqdn %>.pem
</VirtualHost>
