When creating custom sites under the vagrant/apps-folder, nginx is configured to generate and write to application specific access.log-files.
Problem is that user www-data lacks rights to create files in /var/log/nginx
In my nginx error.log these kind of errors was thrown:
2017/07/07 08:29:17 [crit] 20437#20437: *14 open() "/var/log/nginx/calico-access.log" failed (13: Permission denied) while logging request, client: 192.168.13.1, server: ~^(?<sname>.+)\.dev, request: "GET /favicon.ico HTTP/1.1", host: "calico.dev", referrer: "http://www.calico.dev/"
I solved the problem with
sudo chown -R www-data:adm /var/log/nginx
I guess the "correct" solution is to add something like this to cookbooks/nginx/recipes/server.rb
directory '/var/log/nginx' do | owner "www-data" | group "www-data" | end
When creating custom sites under the vagrant/apps-folder, nginx is configured to generate and write to application specific access.log-files. Problem is that user www-data lacks rights to create files in /var/log/nginx
In my nginx error.log these kind of errors was thrown:
2017/07/07 08:29:17 [crit] 20437#20437: *14 open() "/var/log/nginx/calico-access.log" failed (13: Permission denied) while logging request, client: 192.168.13.1, server: ~^(?<sname>.+)\.dev, request: "GET /favicon.ico HTTP/1.1", host: "calico.dev", referrer: "http://www.calico.dev/"
I solved the problem with
sudo chown -R www-data:adm /var/log/nginx
I guess the "correct" solution is to add something like this to cookbooks/nginx/recipes/server.rb
directory '/var/log/nginx' do | owner "www-data" | group "www-data" | end