Nginx configuration disappeared

Questions about HTTP Access/Mods may go here
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
wartab
I'm New!
I'm New!
Posts: 2
Joined: Fri May 26, 2017 10:15 am

Nginx configuration disappeared

Unread post by wartab » Fri May 26, 2017 10:38 am

Hi,

I have been requested to setup a custom web application on a DSM 6 system that uses WebSockets that need to transit through the NAS to go to another web server. I therefore configured nginx as a reverse proxy, as I am used to do on normal Debian/CentOS systems and it worked perfectly for several weeks. I created a file in /etc/nginx/sites-available that configured this.

A few days ago, I also attempted to add a Let's Encrypt certificate on this web application, which I did not succeed in doing due to lack of time and knowledge about Synolgy. I left the server as is, leaving a bogus config file, but making sure not to restart nginx. Fast forwarding to today, I wanted to continue setting up the the certificate and noticed that ALL my custom work has disappeared. The directories /etc/nginx/sites-available, /etc/nginx/conf.d, /usr/syno/certificate have all vanished (and I'm assuming that there are more).

Running "sudo nginx -t" obviously causes nginx to yell about missing files and restarting nginx is failing due to this. Synology's web interface is not working either anymore, because of this.

Does anybody know what causes this and how to avoid this in the future? And most importantly, how can I fix the web interface situation (does someone know where I can find the default nginx config files?)? I'd like to not leave the system in a worse state than when I began using it.

Kind regards

SIGUSRpi
Trainee
Trainee
Posts: 16
Joined: Sat Jul 02, 2016 6:14 pm

Re: Nginx configuration disappeared

Unread post by SIGUSRpi » Sun Jun 04, 2017 6:51 am

I don't have my Synology handy, but I think /etc.defaults/nginx is where you want to look.

wartab
I'm New!
I'm New!
Posts: 2
Joined: Fri May 26, 2017 10:15 am

Re: Nginx configuration disappeared

Unread post by wartab » Sun Jun 04, 2017 12:44 pm

Thanks for you reply. I already figured out how to figure it out. There was a directory in which Synology made a backup of the files it deleted.

What happened is that I left the nginx config with an error, without restarting nginx. Somehow, Synology has a service that checks nginx' config and tries to fix config issues itself by deleting everything (too much, it seems).

hoylemd
I'm New!
I'm New!
Posts: 4
Joined: Sun Jul 08, 2018 5:19 pm

Re: Nginx configuration disappeared

Unread post by hoylemd » Sun Jul 08, 2018 5:20 pm

wartab,

Could you post where that directory was? I'm running into a similar issue.

Post Reply

Return to “HTTP/Apache Mods”