You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the issue is that you need to expose that environment variable in your nginx setup with the env directive. Without it, nginx strips environment variables for security.
I'm using openresty/openresty:1.19.3.1-8-centos7 image. There're some lines like below in the compose yml file used to start container,
environment: - SSL_IMPL=openssl_1.1.1
in nginx.conf file, I have some lua code to retrieve it,
set_by_lua_block $ssl_header{ return os.getenv("SSL_IMPL") or "unknown" }
But the retrieved value is always "unknown".
I entered the container using docker exec /bin/sh, and I can see the SSL_IMPL variable does exist in the shell.
`
admin@origin-dev:/mnt/fastmock$ docker exec fastmock_nginx_1 /bin/sh -c export | grep SSL
export SSL_IMPL="openssl_1.1.1"
`
However, the environ file under /proc for openresty process seems incomplete,
admin@origin-dev:/mnt/fastmock$ docker exec fastmock_nginx_1 cat /proc/1/environ nresty -g daemon off;
Is there any workaround to make the environment variable available?
Thanks in advance.
The text was updated successfully, but these errors were encountered: