Friday, June 18, 2010

wincent.com: Fixing nginx client body temp permission denied errors

wincent.com: Fixing nginx client body temp permission denied errors:

"Diagnosis

Upon inspection, you see that /usr/local/nginx/client_body_temp/ is owned by the user that corresponds to one of your Rails applications (the first one that tried to create it). You'll see the problem only when the second application actually tries to use the client_body_temp folder.

The problem may take a while to materialize because the client_body_temp folder is only used if the body is sufficiently large enough to require it. In my case I saw the error the first time I tried to submit an edit for a wiki article that was beyond a certain size.

The fix

The fix is clear: each nginx master process must have it's own client_body_temp folder. The directive required is client_body_temp_path and it's documented here."