| Syntax: |
env variable [= value ] |
| Default: |
TZ |
| Context: |
main |
| Reference: |
env |
The instruction allows to limit a set of variables of environment, to change it values or to create new variables for following cases:
- inheritance of variables during upgrading the binary with zero downtime ;
- for use by the embedded Perl module
- for use by working processes. However it is necessary to keep in mind, that management of behaviour of system libraries in a similar way probably not always as frequently libraries use variables only during initialization, that is still before they can be set by means of the given instruction. Exception to it is the above described updating an executed file with zero downtime.
If variable TZ is not described obviously it is always inherited and is always accessible to the embedded Perl module.
Example of use:
env MALLOC_OPTIONS;
env PERL5LIB=/data/site/modules;
env OPENSSL_ALLOW_PROXY_CERTS=1;
By default, nginx wipes all its environment variables except TZ variable.
- "env NAME" allows to keep NAME variable value got from parent process, i.e., shell.
- "env NAME=val" sets NAME variable value.
Module: CoreModule