# HG changeset patch # User Kim Alvefur # Date 1684932225 -7200 # Node ID 9c4dc1e6d2c9dca13b2b381e8601137dbf63f1e4 # Parent 8c762a30eae00c6263e74535e62cbc87029742c9 mod_http: Add way to retrieve internal URL instead of external This could be of help when configuring reverse proxies, as it is the internal URL the proxy must point at. Argument treated as an enum "internal" "external"(default) to allow for future extensibility. diff -r 8c762a30eae0 -r 9c4dc1e6d2c9 plugins/mod_http.lua --- a/plugins/mod_http.lua Sat May 20 15:44:55 2023 +0200 +++ b/plugins/mod_http.lua Wed May 24 14:43:45 2023 +0200 @@ -76,11 +76,11 @@ local ports_by_scheme = { http = 80, https = 443, }; -- Helper to deduce a module's external URL -function moduleapi.http_url(module, app_name, default_path) +function moduleapi.http_url(module, app_name, default_path, mode) app_name = app_name or (module.name:gsub("^http_", "")); local external_url = url_parse(module:get_option_string("http_external_url")); - if external_url then + if external_url and mode ~= "internal" then local url = { scheme = external_url.scheme; host = external_url.host;