diff --git a/spec/defines/resource_vhost_spec.rb b/spec/defines/resource_vhost_spec.rb index 4b84415..303e2d6 100644 --- a/spec/defines/resource_vhost_spec.rb +++ b/spec/defines/resource_vhost_spec.rb @@ -290,39 +290,39 @@ describe 'nginx::resource::vhost' do # { # :title => 'should enable IPv6', # :attr => 'ipv6_enable', -# :value => 'true', -# :match => ' listen [::]:80 default ipv6only=on;', -# }, -# { -# :title => 'should enable IPv6', -# :attr => 'ipv6_enable', # :value => true, # :match => ' listen [::]:80 default ipv6only=on;', # }, + { + :title => 'should enable IPv6', + :attr => 'ipv6_enable', + :value => 'true', + :match => ' listen [::]:80 default ipv6only=on;', + }, { :title => 'should disable IPv6', :attr => 'ipv6_enable', :value => 'false', :notmatch => ' listen [::]:80 default ipv6only=on;', }, -# { -# :title => 'should set the IPv6 listen IP', -# :attr => 'ipv6_listen_ip', -# :value => '2001:0db8:85a3:0000:0000:8a2e:0370:7334', -# :match => ' listen [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:80 default ipv6only=on;', -# }, -# { -# :title => 'should set the IPv6 listen port', -# :attr => 'ipv6_listen_port', -# :value => '45', -# :match => ' listen [::]:45 default ipv6only=on;', -# }, -# { -# :title => 'should set the IPv6 listen options', -# :attr => 'ipv6_listen_options', -# :value => 'spdy default', -# :match => ' listen [::]:80 spdy default ipv6only=on;', -# }, + { + :title => 'should set the IPv6 listen IP', + :attr => 'ipv6_listen_ip', + :value => '2001:0db8:85a3:0000:0000:8a2e:0370:7334', + :match => ' listen [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:80 default ipv6only=on;', + }, + { + :title => 'should set the IPv6 listen port', + :attr => 'ipv6_listen_port', + :value => '45', + :match => ' listen [::]:45 default ipv6only=on;', + }, + { + :title => 'should set the IPv6 listen options', + :attr => 'ipv6_listen_options', + :value => 'spdy default', + :match => ' listen [::]:80 spdy default ipv6only=on;', + }, { :title => 'should set servername(s)', :attr => 'server_name', diff --git a/templates/vhost/vhost_ssl_header.erb b/templates/vhost/vhost_ssl_header.erb index 2de8b1e..258748c 100644 --- a/templates/vhost/vhost_ssl_header.erb +++ b/templates/vhost/vhost_ssl_header.erb @@ -1,6 +1,6 @@ server { listen <%= @listen_ip %>:<%= @ssl_port %> ssl<% if @spdy == 'on' %> spdy<% end %><% if @listen_options %><%= @listen_options %><% end %>; - <% 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; <% end %> server_name <%= @rewrite_www_to_non_www ? @name.gsub(/^www\./, '') : @server_name.join(" ") %>;