How do I set the port via environment variable with lua?
Currently my setup sets $port through lua:
server {
set_by_lua_block $port {
return os.getenv("PORT")
listen $port;
}
However, doing so gives me this error:
nginx: [emerg] host not found in "$port" of the "listen" directive in /usr/local/openresty/nginx/conf/nginx.conf:93
Am I doing something wrong? How do I go about doing this?
returnto balance the opening brace?