initial commit
This commit is contained in:
31
angie/autoconf/core-worker-env.conf.j2
Normal file
31
angie/autoconf/core-worker-env.conf.j2
Normal file
@@ -0,0 +1,31 @@
|
||||
{# TODO: investigate error with "include" #}
|
||||
{# {%- include 'core-worker-env.j2inc' -%} #}
|
||||
{%- set w_env = ( j2cfg.core_worker_env or [] ) | any_to_env_dict -%}
|
||||
{#- NB: "TZ" is always provided by Angie itself -#}
|
||||
{%- set w_vars_passthrough = w_env | dict_empty_keys | list_diff(env_vars_preserve + ['TZ']) -%}
|
||||
{%- set vars_passthrough = (env_vars_passthrough + w_vars_passthrough) | uniq | list_intersect(env | dict_keys) -%}
|
||||
|
||||
## NB: "TZ" is always provided by Angie itself
|
||||
|
||||
## preserve
|
||||
{%- for k in env_vars_preserve %}
|
||||
env {{ k | ngx_esc }};
|
||||
{%- endfor %}
|
||||
|
||||
## passthrough
|
||||
{%- for k in vars_passthrough %}
|
||||
env {{ k | ngx_esc }};
|
||||
{%- endfor %}
|
||||
|
||||
{%- set w_vars_override = w_env | dict_non_empty_keys -%}
|
||||
{% if w_vars_override %}
|
||||
## WARNING!
|
||||
## explicit environment variables are NOT implemented
|
||||
## reason: envs are supported only for http_perl but not for http_js/stream_js
|
||||
## solution: provide environment variables explicitly
|
||||
## and then list them in "core_worker_env" key in config
|
||||
##
|
||||
{%- for k in w_vars_override %}
|
||||
## env {{ "{}={}".format(k, w_env[k]) | ngx_esc }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
Reference in New Issue
Block a user