Use correct port for www rewrite

This commit is contained in:
Arthur Leonard Andersen 2013-07-21 17:20:07 +02:00
parent 43d2e86a20
commit 6934271b85
2 changed files with 16 additions and 1 deletions

View file

@ -202,7 +202,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 %>