From 1705c1bc75730d4ddfff6478329bb9ab86d1a1a2 Mon Sep 17 00:00:00 2001 From: Alex Cline Date: Thu, 27 Feb 2014 16:38:55 -0500 Subject: [PATCH] Added support for alternate nginx log directory. Override nginx cookbook log_dir attribute to set. --- README.md | 5 +++++ templates/default/kibana-nginx.conf.erb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ed845dc..058122b 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,11 @@ If you would like to modify the `nginx` or `apache` parameters, you should: - modify the template as you see fit (add auth, setup ssl) - use the appropriate webserver template attributes to point to your cookbook and template +To modify the webserver log path, set the attributes for your selected webserver: + +- `node['apache']['log_dir'] = '/var/log/httpd'` +- `node['nginx']['log_dir'] = '/var/log/nginx'` + Testing ------- #### Vagrant diff --git a/templates/default/kibana-nginx.conf.erb b/templates/default/kibana-nginx.conf.erb index 411567e..139bded 100644 --- a/templates/default/kibana-nginx.conf.erb +++ b/templates/default/kibana-nginx.conf.erb @@ -2,7 +2,7 @@ server { listen <%= @listen_address %>:<%= @listen_port %>; server_name <%= @server_name %> <%= @server_aliases.join(" ") %>; - access_log /var/log/nginx/<%= @server_name %>.access.log; + access_log <%= node['nginx']['log_dir'] %>/<%= @server_name %>.access.log; location / { root <%= @kibana_dir %>;