Merge pull request #128 from leoc/fix-www-rewrite-port

Use correct port for www rewrite
This commit is contained in:
James Fryman 2013-09-06 08:44:49 -07:00
commit 59106eae7c
2 changed files with 16 additions and 1 deletions

View file

@ -211,7 +211,7 @@ define nginx::resource::vhost (
'absent' => absent,
default => 'file',
},
content => template('nginx/vhost/vhost_footer.erb'),
content => template('nginx/vhost/vhost_ssl_footer.erb'),
notify => Class['nginx::service'],
}

View file

@ -0,0 +1,15 @@
<% if @include_files %><% @include_files.each do |file| -%>
include <%= file %>;
<% end -%><% end -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.each do |key,value| -%>
<%= key %> <%= value %>;
<% end -%>
<% end -%>
}
<% if @rewrite_www_to_non_www -%>
server {
listen <%= @listen_ip %>:<%= @ssl_port %> ssl;
server_name www.<%= @name.gsub(/^www\./, '') %>;
rewrite ^ https://<%= @name.gsub(/^www\./, '') %>$uri permanent;
}
<% end %>