  location <%= location %> {
<% if @location_cfg_prepend -%><% location_cfg_prepend.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
    root  <%= www_root %>;
    <% if has_variable?("try_files") then %>
    try_files <% try_files.each do |try| -%> <%= try %> <% end -%>;
    <% end %>
    index <% index_files.each do |i| %> <%= i %> <% end %>; 
<% if @location_cfg_append -%><% location_cfg_append.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
  }

  location <%= location %> {
<% if @location_cfg_prepend -%><% location_cfg_prepend.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
    root  <%= www_root %>;
    <% if @try_files then %>
    try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>;
    <% end %>
    index <% index_files.each do |i| %> <%= i %> <% end %>; 
<% if @location_cfg_append -%><% location_cfg_append.each do |key,value| -%>
    <%= key %> <%= value %>;
<% end -%><% end -%>
  }

Fix in nginx puppet module
Fix in nginx puppet module
