-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
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
os.getenv not work in custom plugin #3424
Comments
You need to add env PATH to your nginx.conf / Kong template file.
|
Hi, Indeed @jeremyjpj0916 is right, this is an expected behaviour from Nginx, which only adds declared environment variables to the worker processes environ variable. BTW, better avoid calling such non JIT-able functions like |
Note env must be set in your Nginx configuration's main context. This can be done by exporting `KONG_NGINX_MAIN_ENV`. See also Kong/kong#3424, https://docs.konghq.com/2.2.x/configuration/, and 0535f0e.
Note env must be set in your Nginx configuration's main context. This can be done by exporting `KONG_NGINX_MAIN_ENV`. See also: * Kong/kong#3424 * https://docs.konghq.com/2.2.x/configuration/ * http://nginx.org/en/docs/ngx_core_module.html#env * 0535f0e
handler.lua
I can not get my environment variables in handler.lua of custom plugin.
The text was updated successfully, but these errors were encountered: