NGINX local.conf overwritten every night

Since a recent MiaB upgrade, I’m finding that any changes I make in the NGINX local.conf file get overwritten every night.

I’m trying to add HTTP response headers. I’ve tried chmod 440 to the file, but that hasn’t stopped the overwrites. How can I stop the overwrites, or add my own HTTP response headers?

I don’t know (I haven’t upgraded yet and have quite a few customizations myself so I’m interested to hear from anyone who does), but can you correlate the modification time with any cron jobs? If not, maybe write a script for that time period to record process running and lsof outputs on the local.conf… failing that, if you can’t get it figured out, script and schedule something to copy your local.conf over the bad one just after that time and restart nginx… :smiley:

The daily tasks are run from cron here at 0300hrs:
/etc/cron.d/mailinabox-nightly
This calls:
cd /home/<your_home_dir>/mailinabox && management/daily_tasks.sh
Which calls:
.management/mailconfig.py
Which calls:
./management/web_update.py

This does the restarts the resets the Nginx configs from what I can see.
I would suggest modifying the cronjob and adding a command
to add back the changes you want, something like:
cd /home/<your_home_dir>/mailinabox && management/daily_tasks.sh && /path/to/your/script

I hope this helps to get you started.

1 Like