But in OpenWrt v17.01 doesn't have the setting, so I can add my own lua script as below, and I can access Luci web interface and "/lua" URL in the same time.
Once I add my own Lua scrpit replace the lua prefix and handler on OpenWrt 18.06, the original luci web page can't access anymore.
Can I add my Lua script and no effect on Luci web service when I use OpenWrt 18.06?
I'm confused about the uci command setting. If I apply your solution then how to use uci command to set prefix?
Can I use below command to set Lua? Thanks a lot.
uci set uhttpd.main.lua_prefix='/luci=/usr/lib/lua/luci/sgi/uhttpd.lua'
uci set uhttpd.main.lua_prefix='/lua=/root/index.lua'
Even remove lua_prefix, home page still redirect to luci page(cgi-bin/luci) and luci web still can work
uci del uhttpd.main.lua_prefix
uci commit uhttpd
/etc/init.d/uhttpd restart
Only add lua_prefix='/lua=/root/index.lua', home page still redirect to luci page(cgi-bin/luci) and luci web still can work. And /lua page can access, no problem.
In 18.06.01, if I change prefix to /lua, home page will redirect to /luci and web show " Not Found
The requested URL /luci was not found on this server."
Could you help to check my issue? How to not redirect home page when I not set "uci add_list uhttpd.main.lua_prefix='/luci=/usr/lib/lua/luci/sgi/uhttpd.lua'", thanks.
I've test uhttpd 2018-11-28-cdfc902a-2 version and 2019-06-16-91fcac34-3, the issue both happened.
After check the issue happened when remove Luci package, it seems I can not use uhttpd server to run my Lua script without Luci.
update...
Sorry, I found that nixio lib be used in my Lua script, so that uhttpd service not work when I remove Luci. it's not a issue.