builds.mapcomplete.org {
	root * public/
	file_server browse
	header {
		+Permissions-Policy "interest-cohort=()"
		Report-To "{\"group\":\"csp-endpoint\", \"max_age\":86400, \"endpoints\":[{\"url\":\"https://report.mapcomplete.org/csp\"}], \"include_subdomains\":true}"
	}
}

mapcomplete.org, www.mapcomplete.org {
	root * public/master/
	try_files {path}.html
	file_server
	header {
		+Permissions-Policy "interest-cohort=()"
		Report-To "{\"group\":\"csp-endpoint\", \"max_age\":86400, \"endpoints\":[{\"url\":\"https://report.mapcomplete.org/csp\"}], \"include_subdomains\":true}"
	}
	handle_errors {
		@404 {
			expression {http.error.status_code} == 404
		}
		rewrite @404 /404.html
		file_server
	}
}

dev.mapcomplete.org {
	root * public/develop/
	try_files {path}.html
	file_server
	header {
		+Permissions-Policy "interest-cohort=()"
		Report-To "{\"group\":\"csp-endpoint\", \"max_age\":86400, \"endpoints\":[{\"url\":\"https://report.mapcomplete.org/csp\"}], \"include_subdomains\":true}"
	}
	handle_errors {
		@404 {
			expression {http.error.status_code} == 404
		}
		rewrite @404 /404.html
		file_server
	}
}

single.mapcomplete.org {
	root * single_theme_builds/
	file_server browse
	header {
		+Permissions-Policy "interest-cohort=()"
		Report-To "{\"group\":\"csp-endpoint\", \"max_age\":86400, \"endpoints\":[{\"url\":\"https://report.mapcomplete.org/csp\"}], \"include_subdomains\":true}"
	}
}


app.mapcomplete.org {
	root * app/
	file_server
	header {
		+Permissions-Policy "interest-cohort=()"
	}
}

velopark.mapcomplete.org {
	root * single_theme_builds/velopark/
	file_server
	header {
		+Permissions-Policy "interest-cohort=()"
		Report-To "{\"group\":\"csp-endpoint\", \"max_age\":86400, \"endpoints\":[{\"url\":\"https://report.mapcomplete.org/csp\"}], \"include_subdomains\":true}"
	}
}

countrycoder.mapcomplete.org {
	root * tiles/
	file_server browse
	header {
		+Permissions-Policy "interest-cohort=()"
		+Access-Control-Allow-Origin *
	}
}

data.mapcomplete.org {
	root * data/
	file_server
	header {
		+Permissions-Policy "interest-cohort=()"
		+Access-Control-Allow-Origin *
		Cache-Control: max-age=86400, public, stale-while-revalidate=86400,stale-if-error=86400
	}
}

report.mapcomplete.org {
	reverse_proxy http://127.0.0.1:2348
}

studio.mapcomplete.org {
	reverse_proxy http://127.0.0.1:1235
	header {
		Report-To "{\"group\":\"csp-endpoint\", \"max_age\":86400, \"endpoints\":[{\"url\":\"https://report.mapcomplete.org/csp\"}], \"include_subdomains\":true}"
	}
}

lod.mapcomplete.org {
	reverse_proxy http://127.0.0.1:2346
}

ipinfo.mapcomplete.org {
	reverse_proxy 127.0.0.1:2347
}
