Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx: 301 the "/" path to "/cgi-bin/luci/" #25718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VergilGao
Copy link

This change will prevent the blank
"LuCI - Lua Configuration Interface" screen
from being displayed for the first time
when accessing luci via a url like 192.168.1.1

Maintainer: @Ansuel
Compile tested: (x86/64, 24.10.0-rc4, Edge)
Run tested: (x86/64, 24.10.0-rc4, Edge)

Description:

When using nginx instead of uhttpd, accessing the root url such as "192.168.1.1" or "my-router.lan" will display a blank page and then jump to the luci page like this.
2025-01-10_09-40-08

Just add the following lines to luci.locations:

location =/ {
	return 301 /cgi-bin/luci/;
}

by this way, the blank page will no longer be displayed, and nginx can handle the redirect by itself.
Because it is a 301 response, the browser will automatically jump to /cgi-bin/luci/ the next time you visit.

If you still see a blank page when accessing the root url after applying this patch, you need to open the browser console page when accessing, find the Network tab, check Disable Cache, and then access the root url

This change will prevent the blank
"LuCI - Lua Configuration Interface" screen
 from being displayed for the first time
 when accessing luci via a url like 192.168.1.1

Signed-off-by: Tianshuai Gao <[email protected]>
@VergilGao VergilGao force-pushed the nginx-add-new-redirect branch from 3c14117 to 270f820 Compare January 10, 2025 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant