We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I'm trying to produce an upstream definition out of a list of possible values:
ENV FALLBACK "50.50.50.50;;51.51.5151;;52.52.52.52" ENV SEPARATOR ";;"
Here is a working piece of template:
upstream fallback { {{ range $index, $value := split .Env.FALLBACK .Env.SEPARATOR }} server {{ $value }}; {{end}} }
Which produces:
upstream fallback { server 50.50.50.50; server 51.51.5151; server 52.52.52.52; }
But I would rather obtain this:
upstream fallback { server 50.50.50.50; server 51.51.5151 backup; server 52.52.52.52 backup; }
I tried:
upstream fallback { {{ range $index, $value := split .Env.FALLBACK .Env.SEPARATOR }} {{ if eq $index 0 }} server {{ $value }}; {{ else }} server {{ $value }} backup; {{ end }} {{end}} }
but I get parsing errors that I can't understand:
2019/06/19 14:44:13 unable to parse template: template: nginx.conf.tmpl:17: unexpected unrecognized character in action: U+00A0 in command
Any ideas?
The text was updated successfully, but these errors were encountered:
U+00A0 is the non-breaking space character - check your template and replace all whitespace with real spaces.
Sorry, something went wrong.
No branches or pull requests
Hello, I'm trying to produce an upstream definition out of a list of possible values:
Here is a working piece of template:
Which produces:
But I would rather obtain this:
I tried:
but I get parsing errors that I can't understand:
Any ideas?
The text was updated successfully, but these errors were encountered: