No access to router admin page

Hello, I am a happy owner of the Flint2 router ( this is my first post hopefully case will sorted quickly.)
I quote my partial chat with gpt chat ( better to understand my problem and what happened):
" I want to display static website when lan server is down means no response on ports 80 and 443 "
chat GPT :
"You can configure your OpenWRT router's Nginx web server to serve a static fallback page when the LAN server (your internal server) is down or not responding on ports 80 and 443. This can be achieved by using Nginx's proxy settings combined with a failover mechanism."
Edit your Nginx configuration (/etc/nginx/nginx.conf or specific virtual host configuration):

  • Add a health check mechanism using Nginx's proxy_pass and error_page directives.

pure chat gpt proposition ( I had adjusted it to my configuration )
put as /etc/nginx/conf.d

server {
listen 80;
server_name your-domain.com;

# Primary upstream: LAN server
upstream lan_server {
    server 192.168.1.100:80;  # Replace with your LAN server's IP and port
    # You can add a second server for load balancing or redundancy
    # server 192.168.1.101:80;
}

location / {
    proxy_pass http://lan_server;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    # Error handling: if the LAN server is down, serve a static page
    error_page 502 503 504 = /fallback.html;
}

# Fallback static page
location = /fallback.html {
    root /var/www/html;  # Path to static fallback page
    internal;  # Makes the fallback page accessible only when the server is down
}

}

I put the adjusted file as /etc/nginx/conf.d/server_wojciech_lol.conf
when checked configuration by
nginx -t
I had an error that 'upstream lan_server' is not proper context or something similar.
so I thought that some NGINX packages had not been installed.
I have router alive 2 days and I didn't change opkg sources and installed it from https://fw.gl-inet.com
I remember in the admin panel list of packages NGINX was shown as unknown or not installed.
I have installed NGINX and some more probably ... :(......!!!
Now I do not have access to web panel
after my mistake when typing
ngnix -t
I have error: unknown directive "gzip static" in /etc/nginx/nginx.conf :22
when commenting on line 22 and run nginx
I have an address in use

  1. how to restore the original NGINX configuration and safely install additional packages?
    2 how to set up a coexisting static website on the router.

Easiest way to get it working again: Reset the router.
Connect via SSH and run firstboot -y && reboot which will reset the device.

Since the router isn't a proxy server, you won't be able to reach your goal. The nginx isn't used when people connect to the internet — the router does not know whether the connection succeeded or not.

Your use case is something you can try to build with squid but let me be honest: Just don't do it, it's not worth it. Every firmware upgrade will delete your config, and you need to start over, mostly.

If I don't want to reset firmware , its too early
and then question is how to restore access to admin panel ?
I need do it in right order
opkg update
opkg install ngnix
what is after
and finally update nginx configuration
in /www folder nothing was changed .

Since I don't know what you really did, I can only recommend resetting the firmware.
Some packages are not re-installable.

Maybe if you are lucky you can get your nginx files from /rom/etc/nginx but nginx is a little hard one and might not be tracked as config by the backup/restore system, i think it doesn't.

/Rom is the readonly partition which is basically a mount of the factory defaults including default configurations, though you always have to check the validity of those, i experienced with closed sdks sometimes a config gets placed by a script rather than 1:1 copy over.

^ oh yeah i remember again, i had that with the wireless config and mtk sdk (mt3000), these defaults where these strange mtk developement ssid names rather than the usual expected wireless defaults by gl inet, so taking things from /rom isn't always 100% valid especially on those sdks, on mainline openwrt it should work as expected.

Like @admon said doing a reset is best.

is it your solution ? for everything to reset firmware ? ??
I don't want to be rude .
can someone tell me which packages should be installed to let web admin panel works properly .
if gl-inet packages do not restore default settings of web panel can someone pack (ZIP package )and send me by content of /etc/ngnix folder
but if I need content of /etc/ngnix folder it's mean that something is wrong !!!!!
and it's Gl-Inet side.
once again I installed packages using GL-Inet side - web interface not openwrt side ( cgi-bin/luci)
all of them are hosted and belongs to GL-inet . Gl-inet firmware is fork of openwrt and coexists which is good.I don't want to flash and replace GL-inet firmware with pure openwrt firmware .in GL-inet has many valuable features
but after your response, I start to think that It might be worth spending some time to do it ?
Second can check is in your software when install packages via plugin manager status unknown or not installed
some packages are explicitly marked as installed
ngnix NOT why ?? This is core part of GL-inet Firmware . If its not displayed as intallled it's huge bug in my opinion
and your solution is reset firmware ..... :frowning:
send me better config files as attachment

You can try this:

opkg update
opkg install gl-sdk4-luci --force-reinstall --force-maintainer

Hopefully that package depends on enough dependencies to replace nginx and default configs back to normal, but no promises.

Especially since you tried to remove and adding things already im worried it will not work.

^ you need ssh for this, you can download putty type ip and then click accept, use root as user and as password your routers ui password.

About the plugin manager:

The plugin manager is the same as OpenWrt package manager, you only use it to install direct software, but not for upgrading packages.

Only if you know exactly what you do, often its only on advise of a developer, since also core components from the kernel are also there, you can easily softbrick a router, so it is not recommended.

This kinda also counts for nginx a little... it could have broken something that it cannot be fixed.

I performed your advice: here is the copied output from ssh :

root@Peter-Router:~# opkg update
Downloading https://fw.gl-inet.com/releases/mt798x/kmod-4.5.7/aarch64_cortex-a53/mediatek/mt7986/Packages.gz
Updated list of available packages in /var/opkg-lists/glinet_core
Downloading https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/glinet/Packages.gz
Updated list of available packages in /var/opkg-lists/glinet_gli_pub
Downloading https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/glinet_gli_packages
Updating database.
Database update completed.
root@Peter-Router:~# opkg install gl-sdk4-luci --force-reinstall --force-maintainer
Removing package gl-sdk4-luci from root...
Updating database.
Database update completed.
Installing gl-sdk4-luci (git-2024.248.34921-f5f8dcd-1) to root...
Collected errors:

  • opkg_download_pkg: Package gl-sdk4-luci is not available from any configured src.
  • opkg_install_pkg: Failed to download gl-sdk4-luci. Perhaps you need to run 'opkg update'?
  • opkg_install_cmd: Cannot install package gl-sdk4-luci.
    root@Peter-Router:~#
    ----------- end of output

I think that something is wrong with GL-inet repo packages ?
what you think ?
gl-sdk4-luci is not in GL-Inet repo ?

It could be that it is named differently, most of these packages start with the prefix gl-sdk4 you want either with luci or nginx in its name.

You can try fetch the list like:

opkg list | grep gl-sdk4

I think that its good idea
I will do it tommorow
I followed your next advice and now I do not have gl-sdk4-luci package due to be uninstalled .

Looks like you broke things to do and not followed what @admon advised for simple question to solve problem.

Overall you did re-install clear ngnix which removed modified GL-iNet package. Just clear simple web server without GL-iNet package.

As you are in the process of finding out, it is normally the quickest way :wink:

1 Like

Don't do it.

This feature is for advanced users who know what they are doing and who know the risks. Spoken for me, I would even say this feature should be removed because it's useless and people get a false feeling of security by using it.

The GL firmware is very customizable - but resetting is part of this process. It's not as open as OpenWrt. It's more like a sandbox with boundaries.