Question

How to prevent nginx from replacing my index.html with default nginx welcome page.

Summary

Every few days/weeks, my index.html page gets replaced with the “Welcome to nginx!” page. I’ve automated reupload enough for it to be a non-issue but i would still like to identify what causes this or fixes the overwriting of my file.

Specs

I am using the latest nginx on a DigitalOcean Droplet as of 03/29/2020. Deployed using latest Ansible as of 03/29/2020.

proposed fixes

Another user poster the same question here but that was in 2016 and no solution has been found yet. Currently I have a cron job alerting me when a file changes and manually run reupload.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

If you are running Ansible you want to make sure that your server config management isn’t overwriting that file itself. You can also check what user the directory and file are owned by. It maybe a permissions issue, it maybe config management overwriting something since you mentioned Ansible, it maybe you are running that directory as nobody:nogroup with 777 permissions and perhaps there is an exploit somewhere.

But this should not be occurring - files don’t get overwritten - and DigitalOcean droplets aren’t fully managed - which means after they are deployed they are yours to use and there is no file level access that DigitalOcean retains to the droplet after it is running.