{
	email {$MIRANNOT_TLS_EMAIL}
	admin off
	persist_config off
	servers {
		max_header_size 64KB
	}
}

http://127.0.0.1:8080 {
	respond /health "ok" 200
}

{$MIRANNOT_DOMAIN} {
	encode zstd gzip
	header {
		-Server
		Strict-Transport-Security "max-age=31536000"
		X-Content-Type-Options "nosniff"
		X-Frame-Options "DENY"
		Referrer-Policy "no-referrer"
	}

	@asset_upload {
		method POST
		path_regexp asset_upload ^/api/v1/admin/tracks/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}/assets$
	}
	handle @asset_upload {
		request_body {
			max_size {$MIRANNOT_PROXY_ASSET_BODY_BYTES}
		}
		reverse_proxy web:3000
	}
	handle {
		request_body {
			max_size {$MIRANNOT_PROXY_MAX_BODY_BYTES}
		}
		reverse_proxy web:3000
	}
}
