Last night I added some storage to my droplet and rsynced my entire /var/www directory to the new drive and then put all the proper info in /etc/fstab to mount it at /var/www. I rebooted and nginx would start but wouldn’t serve any pages. I checked all the permissions under /var/www and everything was 100% correct. I checked every little thing I can imagine and nginx just wouldn’t work. Then I changed /etc/fstab to mount the storage at /var/www2 and then I did a ln -s /var/www2 /var/www and it worked just fine. This suggests to me that either nginx doesn’t like the /var/www directory to be a mountpoint, or that something in how digitalocean is handling the VM and the storage is causing the problem. I’m betting on the former but it’s likely a mixture of the 2.
I need to point out that I checked that I hadn’t mounted in the wrong directory, that the file permissions were correct, etc. and comparing the 2 directories revealed zero differences but nginx still wouldn’t run correctly with the mountpoint. I haven’t tried seeing if I could(after moving files) mount at /var/www/html or the like as by the time I got to the point I am now, I just wanted my websites to work again.
I’ve seen other people have the same kind of problem here but there seemed to be issues with how they were mounted or the like whereas I mounted exactly as they were directed and still had the issues. All that said, this isn’t as much of a plea for help and more of a bug report.
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!
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.