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 static see: https://stackoverflow.com/questions/16808813/nginx-serve-static-file-and-got-403-forbidden

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

example
└── sub1
    └── sub2
        └── static

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

Thanks.

  • @Rick_C137OP
    link
    English
    12 months ago

    Thank you all !

    Indeed setting execute perm on example, sub1, sub2, static

    The program/user have now access to the directory.

    In order words all the parents directory need at least execute in order to have access in the targeted directory…

    Now I gave 751 for static. Meaning than others (here nginx) cannot list the files within. But never the less it works
    the static files are appearing when requested (HTTP) but forbidding nginx to list the directory is changing something ? (performance/security)

    Thanks