:80 {
	encode gzip

	@cache {
		path *.ico *.css *.js *.gif *.webp *.avif *.jpg *.jpeg *.png *.svg *.woff *.woff2 *.html *.ttf *.eot
	}
	header @cache Cache-Control "public, max-age=604800, must-revalidate"

	handle_path /api/* {
		reverse_proxy localhost:8000
	}
	handle /* {
		file_server
		root * /app/dist
		try_files {path} /index.html
	}
}

# example for subdirectory deploy:

# :7777 {
# 	handle_path /chat/api/* {
# 		uri strip_prefix /chat
# 		reverse_proxy :8000
# 	}
# 	handle_path /chat/* {
# 		file_server
# 		root * ./frontend/dist
# 		try_files {path} /index.html
# 	}
# }
