diff --git a/nginx/manifests/init.pp b/nginx/manifests/init.pp index faed91b..a80280e 100644 --- a/nginx/manifests/init.pp +++ b/nginx/manifests/init.pp @@ -13,10 +13,12 @@ class nginx( $user = '_nginx' $group = '_nginx' } + $logdir = '/var/www/logs' } default: { $user = 'nginx' $group = 'nginx' + $logdir = '/var/log/nginx' } } diff --git a/nginx/templates/nginx.conf.erb b/nginx/templates/nginx.conf.erb index 6f2bb90..6d235f9 100644 --- a/nginx/templates/nginx.conf.erb +++ b/nginx/templates/nginx.conf.erb @@ -2,6 +2,8 @@ user <%= @user %>; worker_processes <%= @workers %>; worker_rlimit_nofile 1024; +error_log <%= @logdir %>/error.log; + events { worker_connections 1024; } @@ -10,6 +12,8 @@ http { include mime.types; default_type application/octet-stream; + access_log <%= @logdir %>/access.log combined; + server_tokens off; include conf.d/*.conf;