Use correct port for www rewrite
This commit is contained in:
parent
43d2e86a20
commit
6934271b85
2 changed files with 16 additions and 1 deletions
|
@ -202,7 +202,7 @@ define nginx::resource::vhost (
|
||||||
'absent' => absent,
|
'absent' => absent,
|
||||||
default => 'file',
|
default => 'file',
|
||||||
},
|
},
|
||||||
content => template('nginx/vhost/vhost_footer.erb'),
|
content => template('nginx/vhost/vhost_ssl_footer.erb'),
|
||||||
notify => Class['nginx::service'],
|
notify => Class['nginx::service'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
15
templates/vhost/vhost_ssl_footer.erb
Normal file
15
templates/vhost/vhost_ssl_footer.erb
Normal 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 %>
|
Loading…
Reference in a new issue