Adding Custom Nginx Config variables with set


Is it possible at this time to set variables in the server block without having to directly modify nginx-kong.conf? I imagine it would be similar to this:

For example, I’m using a docker-compose.yml file and I can do the following:

  KONG_NGINX_HTTP_LUA_CODE_CACHE: "off" # evaluates to `lua_code_cache: off;` in http block

but I cannot set a variable in the server block like this:


Because this evaluates to set_$session_secret: secret instead of set $session_secret: secret;

I imagine this is probably a shortcoming to the way this functionality works… just wanted to verify it isn’t a user error before I move forward into a method that requires a completely custom nginx-kong.conf file.

I am debugging and currently trying to accomplish this:


@jerney Did you try doing the following?

 KONG_NGINX_PROXY_SET="$session_secret: secret"

This should render the following line inside the proxy server block:
set $session_secret: secret;