openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.28k stars 2.51k forks source link

Access Multiple Luci behind nginx reverse proxy #5092

Closed vmagnan closed 3 years ago

vmagnan commented 3 years ago

Hi,

I'm trying to create access to multiple OpenWrt Luci through Nginx reverse proxy.

I want to access them with a specif URL, providing the IP of the remote machine: /target-ip/[IP].

Here is the related question I've asked on StackOverflow: https://stackoverflow.com/questions/67787122/multiple-openwrt-luci-behind-nginx-reverse-proxy

PS: I'm gonna recreate the question on SuperUser

----------Edit----------

I've found a pull request to the Luci repository to support reverse proxy with pathname prefix from a cookie: Here

Unfortunately, it has not been merged into the official repo, and I can only use official releases.

jow- commented 3 years ago

You could try modifying the lua_prefix and ubus_prefix options of /etc/config/uhttpd but I suppose it is easier to do use nginx' sub_filter facility to rewrite embedded resource links as needed. See https://serverfault.com/questions/713148/modify-html-pages-returned-by-nginx-reverse-proxy for examples.

vmagnan commented 3 years ago

Thanks for the tip ! Unfortunately, I've tried it, and it didn't work : I was only able to reach the login page I've found another way to bypass this problem, simply by creating a subdomain for each Luci web app.