Nginx – Can’t write to log file in Passenger 2.2.5 with nginx

nginxphusion-passengerruby-on-rails

I have a Rails app, running with nginx and Passenger. Until yesterday, logging worked, but now nginx's error.log shows this message on startup:
Rails Error: Unable to access log file. Please ensure that /var/www/app/htdocs/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

The log file has 0666 permissions. It looked like it may have been related to Issue 332, so I upgraded from Passenger 2.2.4 to 2.2.5. This didn't solve the issue. Logging worked yesterday, and nothing was changed in the configuration since then.

Any ideas?

Best Answer

Please check the directory privs as well:

ls -larth /var/www/app/htdocs/