<VirtualHost *:441>
	ServerName sam.plan.dev
	ServerAlias sam au.sam.plan.dev us.sam.plan.dev
	DocumentRoot "/www/sam.plan.dev"
	ServerAdmin sam@plan.dev
	ErrorLog logs/sam.plan.dev-error_log
	CustomLog logs/sam.plan.dev-access_log combined
	ScriptAlias /x/ /www/sam.plan.dev/x/
	ScriptAlias /a/ /www/sam.plan.dev/a/
	AddHandler cgi-script .cgi
	<Directory "/www/sam.plan.dev">
		Options +Indexes
		Options +FollowSymLinks -SymLinksIfOwnerMatch
		Require all granted
		AllowOverride All
	</Directory>
	<Directory "/www/sam.plan.dev/x">
		AllowOverride None
		Options +ExecCGI -MultiViews
		Options +FollowSymLinks -SymLinksIfOwnerMatch
		Require all granted
	</Directory>
	<Directory "/www/sam.plan.dev/a">
		AllowOverride None
		Options +ExecCGI -MultiViews
		Options +FollowSymLinks -SymLinksIfOwnerMatch
		AuthName "Admin Only"
		AuthType Basic
		AuthUserFile /www/sam.plan.dev/.htpasswd
		Require valid-user
	</Directory>
	<Directory "/www/sam.plan.dev/logout">
		AllowOverride None
		authname "Admin Only"
		authtype basic
		authuserfile /www/sam.plan.dev/logout/.htpasswd
		require valid-user
	</Directory>
	<Directory "/www/sam.plan.dev/log">
		Options +FollowSymLinks -SymLinksIfOwnerMatch
		AllowOverride None
		AuthName "Admin Only"
		AuthType Basic
		AuthUserFile /www/sam.plan.dev/.htpasswd
		Require valid-user
	</Directory>

	<FilesMatch "^\.">
		order allow,deny
		deny from all
	</FilesMatch>

	ProxyRequests Off
	ProxyPreserveHost On
	ProxyVia Full
	<Proxy *>
		Require all granted
	</Proxy>
	<Location /ssh/>
		ProxyPass http://127.0.0.1:2222/ssh/
		ProxyPassReverse http://127.0.0.1:2222/ssh/
	</Location>

	AddDefaultCharset utf-8
	RewriteEngine on
	RewriteRule ^/resume(.*)$ https://sam.ucm.dev/resume$1 [L]
#	RewriteRule ^/example$ https://example.com/ [L]
	SSLCertificateFile /etc/letsencrypt/live/plan.dev/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/plan.dev/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<VirtualHost *:80>
	ServerName sam.plan.dev
	ServerAlias sam au.sam.plan.dev us.sam.plan.dev
	DocumentRoot "/www/sam.plan.dev"
	ServerAdmin sam@plan.dev
	ErrorLog logs/sam.plan.dev-error_log
	CustomLog logs/sam.plan.dev-access_log combined
	RewriteEngine on
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</VirtualHost>
