{$SCHEME}://www.{$MAIN_DOMAIN} {
	import authelia_middleware
	header {
		Cache-Control "public, max-age=10"
		import header_common
	}

	handle_errors {
		@notFound expression `{http.error.status_code} == 404`
		redir @notFound https://www.{$MAIN_DOMAIN} permanent
	}

	reverse_proxy homepage:3000
}

{$SCHEME}://{$MAIN_DOMAIN} {
	redir https://www.{$MAIN_DOMAIN}{uri} permanent
}

{$SCHEME}://public.{$MAIN_DOMAIN} {
	root * /public_data
	file_server browse

	header / {
		Cache-Control "no-store"
		import header_common
	}
}
