There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Recursive execute(x) required to enable nginx to read a directory !??

Hi,

I’ve noticed something quite odd, but I don’t know if the problem come from Linux itself or nginx…

In order to grant nginx access to a directory let say your staticsee: stackoverflow.com/…/nginx-serve-static-file-and-g…

These parent directories “/”, “/root”, “/root/downloads” should give the execute(x) permission to ‘www-data’ or ‘nobody’. i.e.

but it seem not only the direct parent need to be given XX5 but all the chain

for example


<span style="color:#323232;">example
</span><span style="color:#323232;">└── sub1
</span><span style="color:#323232;">    └── sub2
</span><span style="color:#323232;">        └── static
</span>

it seem you need to set allow others to read and execute 5all the parents example, sub1, sub2 Why is that !?? I’ve found it so akward and unsecure ! is there a workaround ?

Thanks.

Markaos ,

Probably a bit of a TL:DR of the other answer, but the short answer is: the execute bit has a different meaning for directories - it allows you to keep going down the filesystem tree (open a file or another directory in the directory). The read bit only allows you to see the names of the files in the directory (and maybe some other metadata), but you cannot open them without x bit.

Fun fact, it makes sense to have a directory with --x or -wx permissions - you can access the files inside if you already know their names.

Edit: not a short answer, apparently

bionicjoey ,

It’s a property of how Linux permissions work when applied to a directory.

See this SE post for more info: unix.stackexchange.com/a/21252

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines