* Fixed log name in template vhost_ssl_header

* Better formatting for vhost_autogen.conf
This commit is contained in:
Lebedev Vadim 2013-07-08 18:58:05 +04:00
parent 0ea33de6ac
commit 413271f84d
4 changed files with 22 additions and 22 deletions

View file

@ -1,14 +1,12 @@
<% if @include_files %><% @include_files.each do |file| -%> <% if @include_files %><% @include_files.each do |file| -%>
include <%= file %>; include <%= file %>;
<% end -%><% end -%> <% end -%><% end -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.each do |key,value| -%> <% if @vhost_cfg_append -%><% vhost_cfg_append.each do |key,value| -%>
<%= key %> <%= value %>; <%= key %> <%= value %>;
<% end -%><% end -%> <% end -%>
<% end -%>
} }
<% if rewrite_www_to_non_www -%>
<% if rewrite_www_to_non_www %>
server { server {
listen <%= listen_ip %>; listen <%= listen_ip %>;
server_name www.<%= name.gsub(/^www\./, '') %>; server_name www.<%= name.gsub(/^www\./, '') %>;

View file

@ -1,22 +1,23 @@
server { server {
listen <%= listen_ip %>:<%= listen_port %> <% if @listen_options %><%= listen_options %><% end %>; listen <%= listen_ip %>:<%= listen_port %><% if @listen_options %> <%= listen_options %><% end %>;
<% # check to see if ipv6 support exists in the kernel before applying %> <% # check to see if ipv6 support exists in the kernel before applying %>
<% if ipv6_enable == 'true' && (defined? ipaddress6) %> <% if ipv6_enable == 'true' && (defined? ipaddress6) %>
listen [<%= ipv6_listen_ip %>]:<%= ipv6_listen_port %> <% if @ipv6_listen_options %><%= ipv6_listen_options %><% end %> ipv6only=on; listen [<%= ipv6_listen_ip %>]:<%= ipv6_listen_port %> <% if @ipv6_listen_options %><%= ipv6_listen_options %><% end %> ipv6only=on;
<% end %> <% end %>
server_name <%= rewrite_www_to_non_www ? name.gsub(/^www\./, '') : server_name.join(" ") %>; server_name <%= rewrite_www_to_non_www ? name.gsub(/^www\./, '') : server_name.join(" ") %>;
access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/<%= name %>.access.log; access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/<%= name %>.access.log;
<% if defined? auth_basic -%> <% if defined? auth_basic -%>
auth_basic "<%= auth_basic %>"; auth_basic "<%= auth_basic %>";
<% end -%> <% end -%>
<% if defined? auth_basic_user_file -%> <% if defined? auth_basic_user_file -%>
auth_basic_user_file <%= auth_basic_user_file %>; auth_basic_user_file <%= auth_basic_user_file %>;
<% end -%> <% end -%>
<% proxy_set_header.each do |header| %> <% proxy_set_header.each do |header| -%>
proxy_set_header <%= header %>;<% end %> proxy_set_header <%= header %>;
<% if @rewrite_to_https %> <% end -%>
<% if @rewrite_to_https -%>
if ($ssl_protocol = "") { if ($ssl_protocol = "") {
return 301 https://$host$request_uri ; return 301 https://$host$request_uri ;
} }
<% end %> <% end -%>

View file

@ -19,3 +19,4 @@
<%= key %> <%= value %>; <%= key %> <%= value %>;
<% end -%><% end -%> <% end -%><% end -%>
} }

View file

@ -14,7 +14,6 @@ server {
ssl_protocols <%= ssl_protocols %>; ssl_protocols <%= ssl_protocols %>;
ssl_ciphers <%= ssl_ciphers %>; ssl_ciphers <%= ssl_ciphers %>;
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
<% if auth_basic != :undef -%> <% if auth_basic != :undef -%>
auth_basic "<%= auth_basic %>"; auth_basic "<%= auth_basic %>";
<% end -%> <% end -%>
@ -22,5 +21,6 @@ server {
auth_basic_user_file <%= auth_basic_user_file %>; auth_basic_user_file <%= auth_basic_user_file %>;
<% end -%> <% end -%>
access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/ssl-<%= name %>.access.log; access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/ssl-<%= name.gsub(' ', '_') %>.access.log;
error_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/ssl-<%= name %>.error.log; error_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/ssl-<%= name.gsub(' ', '_') %>.error.log;