OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: Krischan on January 08, 2022, 01:13:37 AM

Title: Nginx config reset?
Post by: Krischan on January 08, 2022, 01:13:37 AM
Something about the recent Nginx update messed up my configuration (it somehow fails to add a listen to one of the server configs according to "nginx -t") and as I am running out of ideas how to fix it, I would like to fully reset the configuration and start new.

However even after rm the entire /usr/local/etc/nginx folder the broken old config comes up again in the OPNsense GUI.

I looked around, but I can't seem to find where the config files really are.

Thanks for the help.

P.S.: And pointers why the update broke my config would be also appreciated as this is the first time this happened after 2 years using OPNsense with the same Nginx config.
Title: Re: Nginx config reset?
Post by: Greelan on January 08, 2022, 01:53:40 AM
I assume the nginx config data is in /conf/config.xml
Title: Re: Nginx config reset?
Post by: Fright on January 08, 2022, 03:55:32 PM
Quoteomething about the recent Nginx update messed up my configuration
imho model migration for "Listen Port directives to Listen Address" nginx plugin (introduced in 21.7.6) update may fail sometimes
try to check all http and stream servers config for correct server addresses and ports config and apply again
(you can get string number from error message and figure out the server containing the error from the /usr/local/etc/nginx/nginx.conf file)
Title: Re: Nginx config reset?
Post by: Krischan on January 10, 2022, 01:46:55 AM
Thanks for the help so far.

But it is really strange... even after cleaning up everything and recreating a basic config (and triple-checking everything) nothing seems to work anymore with Nginx as a reverse-proxy, not even a basic http redirection.

It does however start again now, so the problem seems to be somewhere else.

The exact same config was working fine before with multiple websites and SNI redirection etc.

Is there anything that changed significantly that needs to be adapted for the config?

Can anyone confirm that Nginx is still working at all after this update?
Title: Re: Nginx config reset?
Post by: Fright on January 10, 2022, 07:16:15 AM
QuoteIs there anything that changed significantly that needs to be adapted for the config?
dont think so. https://github.com/opnsense/plugins/blob/master/www/nginx/pkg-descr

QuoteCan anyone confirm that Nginx is still working at all after this update?
can confirm. works

imho it's worth checking the config and looking at the logs
Title: Re: Nginx config reset?
Post by: Krischan on January 10, 2022, 01:52:01 PM
That is the odd thing, there is nothing relevant in the logs either.

I am starting to think that something changed so that my firewall rules that point incoming connections to port 80/443 don't work any longer. That would also be consistent with the observation that the connections just time out when trying to open the pages in a browser.

Could you please share how your firewall rule is set up in the working config? Thanks!
Title: Re: Nginx config reset?
Post by: Fright on January 10, 2022, 06:11:39 PM
QuoteCould you please share how your firewall rule is set up in the working config?
nothing out of the ordinary here: just rules that open the ports that nginx listens to
maybe there are problems with the config or running nginх not starting (cannot bind to the address, problems with certificates?) is there anything interesting in the Nginx global errors log?