{
	servers {
		timeouts {
			read_body 10s
			read_header 10s
			idle 30s
		}
	}
}

(hotel_mittal_guest) {
	encode gzip
	root * /opt/hotel-mittal-public/www
	header {
		X-Robots-Tag "noindex, nofollow"
		X-Content-Type-Options nosniff
		Referrer-Policy strict-origin-when-cross-origin
	}
	@home {
		method GET HEAD
		path /
	}
	redir @home /kamra/stay/hotel-mittal 302

	@files {
		method GET HEAD
		path /assets/kamra/frontend/* /source.tar.gz
	}
	handle @files {
		file_server
	}
	@pages {
		method GET HEAD
		path /kamra/book /kamra/book/* /kamra/stay/hotel-mittal /kamra/stay/hotel-mittal/*
	}
	handle @pages {
		rewrite * /preview.html
		file_server
	}
	@identity {
		method POST
		path /api/method/kamra.api.whoami
	}
	handle @identity {
		header Content-Type application/json
		respond `{"message":{"user":"Guest","full_name":"Guest","roles":[]}}`
	}
	@catalog {
		method POST
		path /api/method/kamra.public_api.catalog_index /api/method/kamra.public_api.resolve_slug /api/method/kamra.public_api.showcase /api/method/kamra.public_api.search_stay
	}
	handle @catalog {
		request_body {
			max_size 4KB
		}
		reverse_proxy 127.0.0.1:18801
	}
	handle {
		respond "This page or action is unavailable on the public preview." 404
	}
}

hotelmittal.in {
	import hotel_mittal_guest
}

www.hotelmittal.in {
	redir https://hotelmittal.in{uri} permanent
}
