mod_http: Expand $host in http_paths
authorKim Alvefur <zash@zash.se>
Mon, 18 Feb 2013 13:12:14 +0100
changeset 5332 5b73ac268a9e
parent 5331 ffa740b4f08d
child 5333 760c345dc7a1
mod_http: Expand $host in http_paths
plugins/mod_http.lua
--- a/plugins/mod_http.lua	Tue Feb 12 03:24:41 2013 +0100
+++ b/plugins/mod_http.lua	Mon Feb 18 13:12:14 2013 +0100
@@ -38,9 +38,10 @@
 end
 
 local function get_base_path(host_module, app_name, default_app_path)
-	return normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host
+	return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host
 		or module:get_option("http_paths", {})[app_name] -- Global
-		or default_app_path); -- Default
+		or default_app_path)) -- Default
+		:gsub("%$(%w+)", { host = module.host });
 end
 
 local ports_by_scheme = { http = 80, https = 443, };