Nginx cache opendir failed


On a Freebsd 9.1 machine
Nginx 1.4.1

opendir() “/var/cache/www/nginx2” failed (13: Permission denied)

microcache dir :
drwxr-x–x 3 root wheel 512 May 19 17:05 /var/cache
drwxr-xr-x 3 www www 512 May 19 17:06 /var/cache/www
drwx------ 2 www www 512 May 19 17:06 nginx2

How to correct this ?



Just chmod 7777 ( 4 seven) /var/cache/www , the parent directory of the
nginx cache and voil, it works.

Le 19 mai 2013 17:51, Ronald Van A. [email protected] a crit :

So, you need to ensure all files can only be deleted by the owner, all
files created in the directory are in the same group as the directory
and, to the best of my knowledge, setuid is meaningless.

Ah, I see that it’s a freebsd machine… setgid is the default
functionality on that OS.

This may work, but a basic understanding of file permissions will
produce a more workable solution. Who runs the web server? That’s who
you need to set access up for.


the Web server is run by “www” , and owns the parent directory of the

Le 20 mai 2013 11:19, Stev e Holdoway [email protected] a crit :