diff --git a/spec/defines/resource_vhost_spec.rb b/spec/defines/resource_vhost_spec.rb index f8c6616..4369808 100644 --- a/spec/defines/resource_vhost_spec.rb +++ b/spec/defines/resource_vhost_spec.rb @@ -53,7 +53,7 @@ describe 'nginx::resource::vhost' do ^ \s+listen\s+\*:80;\n \s+server_name\s+www\.rspec\.example\.com;\n - \s+return\s+301\s+http://rspec\.example\.com\$uri; + \s+return\s+301\s+http://rspec\.example\.com\$request_uri; |x, }, { @@ -64,7 +64,7 @@ describe 'nginx::resource::vhost' do ^ \s+listen\s+\*:80;\n \s+server_name\s+www\.rspec\.example\.com;\n - \s+return\s+301\s+http://rspec\.example\.com\$uri; + \s+return\s+301\s+http://rspec\.example\.com\$request_uri; |x, }, { @@ -276,7 +276,7 @@ describe 'nginx::resource::vhost' do ^ \s+listen\s+\*:443\s+ssl;\n \s+server_name\s+www\.rspec\.example\.com;\n - \s+return\s+301\s+https://rspec\.example\.com\$uri; + \s+return\s+301\s+https://rspec\.example\.com\$request_uri; |x, }, { @@ -341,7 +341,7 @@ describe 'nginx::resource::vhost' do ^ \s+listen\s+\*:443\s+ssl;\n \s+server_name\s+www\.rspec\.example\.com;\n - \s+return\s+301\s+https://rspec\.example\.com\$uri; + \s+return\s+301\s+https://rspec\.example\.com\$request_uri; |x, }, { @@ -352,7 +352,7 @@ describe 'nginx::resource::vhost' do ^ \s+listen\s+\*:443\s+ssl;\n \s+server_name\s+www\.rspec\.example\.com;\n - \s+return\s+301\s+https://rspec\.example\.com\$uri; + \s+return\s+301\s+https://rspec\.example\.com\$request_uri; |x, }, { @@ -597,7 +597,7 @@ describe 'nginx::resource::vhost' do ^ \s+listen\s+\*:443\s+ssl;\n \s+server_name\s+www\.rspec\.example\.com;\n - \s+return\s+301\s+https://rspec\.example\.com\$uri; + \s+return\s+301\s+https://rspec\.example\.com\$request_uri; |x, }, { diff --git a/templates/vhost/vhost_header.erb b/templates/vhost/vhost_header.erb index ce343a2..9f482eb 100644 --- a/templates/vhost/vhost_header.erb +++ b/templates/vhost/vhost_header.erb @@ -2,7 +2,7 @@ server { listen <%= @listen_ip %>:<%= @listen_port %>; server_name www.<%= @server_name[0].gsub(/^www\./, '') %>; - return 301 http://<%= @server_name[0].gsub(/^www\./, '') %>$uri; + return 301 http://<%= @server_name[0].gsub(/^www\./, '') %>$request_uri; } <% end -%> diff --git a/templates/vhost/vhost_ssl_header.erb b/templates/vhost/vhost_ssl_header.erb index 35de38d..e4b1c52 100644 --- a/templates/vhost/vhost_ssl_header.erb +++ b/templates/vhost/vhost_ssl_header.erb @@ -2,7 +2,7 @@ server { listen <%= @listen_ip %>:<%= @ssl_port %> ssl; server_name www.<%= @server_name[0].gsub(/^www\./, '') %>; - return 301 https://<%= @server_name[0].gsub(/^www\./, '') %>$uri; + return 301 https://<%= @server_name[0].gsub(/^www\./, '') %>$request_uri; } <% end -%>