aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/uhttpd/files/uhttpd.config
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-08-23 09:07:23 +0200
committerJo-Philipp Wich <jo@mein.io>2018-08-23 09:18:04 +0200
commit214146c6f298e593695c29b8c04a418dac914040 (patch)
tree6e87d7ee4acccecf7e668ae70c61bd666c1a8695 /package/network/services/uhttpd/files/uhttpd.config
parent7e73e9128f6a63b9198c88eea97c267810447be4 (diff)
downloadupstream-214146c6f298e593695c29b8c04a418dac914040.tar.gz
upstream-214146c6f298e593695c29b8c04a418dac914040.tar.bz2
upstream-214146c6f298e593695c29b8c04a418dac914040.zip
uhttpd: support multiple Lua prefixes
Update to latest git HEAD in order to support configuring multiple concurrent Lua prefixes in a single uhttpd instance: b741dec lua: support multiple Lua prefixes Additionally rework the init script and update the default configuration example to treat the lua_prefix option as key=value uci list, similar to the interpreter extension mapping. Support for the old "option lua_prefix" plus "option lua_handler" notation is still present. Finally drop the sed postinstall hack in uhttpd-mod-lua to avoid mangling files belonging to other packages. Since Lua prefixes have precedence over CGI prefixes, simply register `/cgi-bin/luci` as Lua handler which will only become active if both luci-base and uhttpd-mod-lua is installed. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/network/services/uhttpd/files/uhttpd.config')
-rw-r--r--package/network/services/uhttpd/files/uhttpd.config11
1 files changed, 7 insertions, 4 deletions
diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config
index a7d769e188..a3deb9cf04 100644
--- a/package/network/services/uhttpd/files/uhttpd.config
+++ b/package/network/services/uhttpd/files/uhttpd.config
@@ -49,10 +49,13 @@ config uhttpd main
# list interpreter ".php=/usr/bin/php-cgi"
# list interpreter ".cgi=/usr/bin/perl"
- # Lua url prefix and handler script.
- # Lua support is disabled if no prefix given.
- option lua_prefix /luci
- option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua
+ # List of prefix->Lua handler mappings.
+ # Any request to an URL beneath the prefix
+ # will be dispatched to the associated Lua
+ # handler script. Lua support is disabled when
+ # no handler mappings are specified. Lua prefix
+ # matches have precedence over the CGI prefix.
+ list lua_prefix "/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua"
# Specify the ubus-rpc prefix and socket path.
# option ubus_prefix /ubus