nginx template file variable

Viewed 7

I have set up a env variable on docker:

    environment:
      - VIRTUAL_PORT=8000
      - HTTPS_METHOD=redirect
      - MIRROR=disable

and on nginx.tmpl file I use https_method as an example:

{{/* Get the HTTPS_METHOD defined by containers w/ the same vhost, falling back to "redirect" */}}
{{ $https_method := or (first (groupByKeys $containers "Env.HTTPS_METHOD")) (or $.Env.HTTPS_METHOD "redirect") }}

and add:

{{ $mirror := or (first (groupByKeys $containers "Env.MIRROR")) (or $.Env.MIRROR "enable") }}

however on the nginx conf file generated mirror is always "enable".

Thank you

0 Answers
Related