How can I concatenate a variable in a string that is used a Go template? This is the original line (from https://github.com/nginx-proxy/nginx-proxy/blob/master/nginx.tmpl):
{{ $host := trim $host }}
{{ $is_regexp := hasPrefix "~" $host }}
{{ $upstream_name := when $is_regexp (sha1 $host) $host }}
{{ $access_log := (or (and (not $.Env.DISABLE_ACCESS_LOGS) "access_log /var/log/nginx/access.log vhost;") "") }}
I am trying to use variable "host" in that string like this:
{{ $host := trim $host }}
{{ $is_regexp := hasPrefix "~" $host }}
{{ $upstream_name := when $is_regexp (sha1 $host) $host }}
{{ $access_log := (or (and (not $.Env.DISABLE_ACCESS_LOGS) "access_log /var/log/nginx/" + $host + "_access.log vhost;") "") }}
But I get this error:
Unable to parse template: template: nginx.tmpl:175: illegal number syntax: "+"