Changeset

5332:5b73ac268a9e

mod_http: Expand $host in http_paths
author Kim Alvefur <zash@zash.se>
date Mon, 18 Feb 2013 13:12:14 +0100
parents 5331:ffa740b4f08d
children 5333:760c345dc7a1
files plugins/mod_http.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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, };