nginx: 301 the "/" path to "/cgi-bin/luci/" #25718
Open
+5
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just add the following lines to
luci.locations
: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