Nginx configuration disappeared

Questions about HTTP Access/Mods may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
wartab
I'm New!
I'm New!
Posts: 2
Joined: Fri May 26, 2017 10:15 am

Nginx configuration disappeared

Postby 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: 11
Joined: Sat Jul 02, 2016 6:14 pm

Re: Nginx configuration disappeared

Postby 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

Postby 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).

Return to “HTTP/Apache Mods”

Who is online

Users browsing this forum: No registered users and 1 guest