Hi guys,
I'm trying to do the following in my template:
location <%= location %> {
proxy_pass <%= proxy %>;
<% if scope.lookupvar('nginx::resource::location::proxy_header') then
scope.lookupvar('nginx::resource::location::proxy_header').each do |header| %>
proxy_set_header <%= header %>
<% end %>
}
But i'm getting this error instead:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: compile error
/etc/puppet/modules/nginx/templates/vhost/vhost_location_proxy.erb:9: syntax error, unexpected $end, expecting kEND
; _erbout
^
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
I've tried changing to
<% if scope.lookupvar('nginx::resource::location::proxy_header')
scope.lookupvar('nginx::resource::location::proxy_header').each do |header| %>
and
<% if scope.lookupvar('nginx::resource::location::proxy_header') %>
<% scope.lookupvar('nginx::resource::location::proxy_header').each do |header| %>
and
<% if scope.lookupvar('nginx::resource::location::proxy_header') then scope.lookupvar('nginx::resource::location::proxy_header').each do |header| %>
but none of these are working. Any pointers are definitely appreciated