Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been getting this error

2013/03/13 13:25:07 [crit] 49299#0: *38 rename() "/var/tmp/nginx/fastcgi_temp/6/00/0000000006" to "/var/cache/nginx/microcache/8/fd/c36e398490d9b70e3c98ba094d065fd8" failed (13: Permission denied) while reading upstream

I tried other informations in Nginx and SO forums like changing the owner of folder/file, deleting the microcache folder for Nginx to create new by itself, but nothing seems to work.

My Nginx config has www as user(owner, in FreeBSD) all these folders /var/tmp/nginx/fastcgi_temp/ and /var/cache/nginx/microcache/ has www as user(owner) and wheel as group.

To test it I even gave -R 777 to those above mentioned folders and restart nginx, but error.log still says same error. Can't even think of what might possibly be wrong here, any guidance would be appreciated.

share|improve this question
    
Great idea to willy-nilly set permissions across the board to 0777. Better install that machine from scratch now, it is probably mesed up beyond repair. –  vonbrand Mar 29 '13 at 0:14
    
I know 0777 is not right thing, but 0777 was just for two folders under fastcgi_tmp and microcache to test, I changed it back to 766, if you read my answer below –  Jhilke Dai Mar 29 '13 at 1:15
add comment

1 Answer

up vote 2 down vote accepted

I fixed this up with giving permission to its parent directories. /var/cache/nginx all had Read Only permissions, while /var/cache/nginx/microcache/ had All permissions, it worked only after I changed /var/ , /var/cache/ and /var/cache/nginx/ permission to 766. This is still weird but it works for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.