Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow format_log in ssl vhosts as well #332

Merged
merged 2 commits into from
Jun 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@

$access_log_real = $format_log ? {
undef => $access_log_tmp,
default => "${access_log_tmp} $format_log",
default => "${access_log_tmp} ${format_log}",
}

$error_log_real = $error_log ? {
Expand Down Expand Up @@ -478,11 +478,21 @@
# Create SSL File Stubs if SSL is enabled
if ($ssl == true) {
# Access and error logs are named differently in ssl template
$ssl_access_log = $access_log ? {

# This was a lot to add up in parameter list so add it down here
# Also opted to add more logic here and keep template cleaner which
# unfortunately means resorting to the $varname_real thing
$ssl_access_log_tmp = $access_log ? {
undef => "${nginx::params::nx_logdir}/ssl-${name_sanitized}.access.log",
default => $access_log,
}
$ssl_error_log = $error_log ? {

$ssl_access_log_real = $format_log ? {
undef => $ssl_access_log_tmp,
default => "${ssl_access_log_tmp} ${format_log}",
}

$ssl_error_log_real = $error_log ? {
undef => "${nginx::params::nx_logdir}/ssl-${name_sanitized}.error.log",
default => $error_log,
}
Expand Down
4 changes: 2 additions & 2 deletions templates/vhost/vhost_ssl_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ server {
index <% Array(@index_files).each do |i| %> <%= i %><% end %>;
<% end -%>

access_log <%= @ssl_access_log %>;
error_log <%= @ssl_error_log %>;
access_log <%= @ssl_access_log_real %>;
error_log <%= @ssl_error_log_real %>;

<% if @vhost_cfg_prepend -%><% @vhost_cfg_prepend.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
<% if value.is_a?(Hash) -%><% value.each do |subkey,subvalue| -%>
Expand Down