I think I broke nginx

Status
Not open for further replies.

tedrock

Dabbler
Joined
Oct 9, 2013
Messages
14
So I foolishly was changing some stuff in /usr/local/etc/nginx/nginx.conf (I made a backup first).

I actually undid the changes when they didn't work as I hoped and then I stopped being able to access the web GUI.

I restarted but it still didn't work and the backup I made vanished and the conf file looks to be reset to default.

If I try to access freenas now via https://192.168.1.80/ it redirects me to https://192.168.1.80/account/login/?next=/ and the connection times out.

Any idea what is going on here and now to fix it?

I can restart the service and the config file does pass the sanity check.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
If your nginx.conf file did in fact revert to it's default settings then timing out while attempting to https would be normal behavior. Lose the "s" and re attempt to log in using http followed by your web gui address.

Why you are attempting to change core system settings is beyond me. You start mucking with core system settings and things end up not working as a "system" any more. There are secure ways to connect to your freenas gui and this is not one of them.

Having said all that the need to connect to a local LAN address via https is beyond me.
 
Last edited:

tedrock

Dabbler
Joined
Oct 9, 2013
Messages
14
If your nginx.conf file did in fact revert to it's default settings then timing out while attempting to https would be normal behavior. Lose the "s" and re attempt to log in using http followed by your web gui address.

If I try http://192.168.1.80 it redirects to https://192.168.1.80/account/login/?next=/ and Chrome reports ERR_CONNECTION_REFUSED

Why you are attempting to change core system settings is beyond me. You start mucking with core system settings and things end up not working as a "system" any more. There are secure ways to connect to your freenas gui and this is not one of them.

I agree, that's why I admitted it was a foolish thing to do. I was attempting to setup a reverse proxy and figured there was no harm in adding a new block to the config file.

Thank you for your suggestion

You think an advise given by someone with 1400(+) messages is lazy troubleshooting? and how about you not respecting forums rules?
Which rules am I not respecting? I also don't see the relevance that someones post count has on their advice.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Just to keep the record straight, I didn't suggest the reinstallation, @hugovsky did. I think it makes sense, though, if @tedrock's objective is to get his system working properly. If the objective is to figure out what went wrong, of course, that wouldn't do much for him.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Sorry about that danb35, my mistake.
 

tedrock

Dabbler
Joined
Oct 9, 2013
Messages
14
...the objective is to figure out what went wrong, of course, that wouldn't do much for him.

This is what I'd like to learn, I understand a reinstall would fix it, but it confuses me how if the file has apparently reverted, and I only edited that one file, why this would be occurring. I'm starting to think it did not revert and I must have deleted more than my changes. I wasn't aware that the backup I made of the conf file would be deleted if left in that directory which is frustrating because I did take measures to undo my tinkering.

In regards to reinstalling, when I restore my backup config is that all I have to do? Do all my jails, plugs, and storage just return, or do I have to readd them?
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
The clean installation is the best idea here. This is an appliance, not a general purpose server, and should not be seen as such. Futzing around with the appliance core files should never even be considered. Treat it like a proprietary appliance and life will be much better. If there is an enhancement that you feel should be made, please log it on the bug tracker
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
In the future, the verify install function should be able to fix anything a new install can fix - currently, it's still somewhat unpolished.

Older boot snapshots may also work.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Are you using a browser extension that forces https?
 
Joined
Mar 6, 2014
Messages
686
Are you using a browser extension that forces https?
He probably set the option to redirect http requests to https in the General settings.
If i remember correctly, i had this problem once. Clearing browser cache, history, etc. fixed this for me. Not sure, but might be worth the try.
 
Status
Not open for further replies.
Top