Score:0

nginx unable to see files in external hdd

cn flag

What I'm trying to do: I'm trying to have a website on nginx (Ubuntu) where all its files are stored in an external hard disk.

What I did: I connected the hard disk via usb, added it to /etc/fstab by adding this line so now I can see/open/edit any file in /mnt/hdd:

UUID=7EBAF846BAF7F90B /mnt/hdd ntfs-3g uid=1000,gid=1000,nofail,umask=007 0 0

The Problem: When I try to set nginx root to /mnt/hdd it returns 404, I can only set it to /mnt, anything lower is invisible to nginx.

What I tried to fix: I tried to create a .php file that listed all the files & dirs in /mnt and it doesnt see /hdd. Also, I tried to set the permission of all subfiles & dirs to 777 but they remain to 770 for some reason...

in flag
Many web servers will not accept directories with `777` permissions as that's a recipe for disaster. Is your machine running AppArmor? If so, then you'll need to edit the profile for `nginx` so that it can access the external device.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.