Hello I am new to nginx and openresty.
I am trying to dynamically route tcp connections.
But content_by_lua_block doesn't seems to be working in tcp proxy_pass configuration however it worked with example http configuration.
error_log logs/error.log;
events {
worker_connections 1024;
}
stream {
# define a TCP server listening on the port 8080:
server {
listen 8080;
set $target '';
content_by_lua_block {
ngx.var.target = "127.0.0.1:7000"
}
proxy_pass $target;
}
}
But when i tried to add
set $target "127.0.0.1:7000";
It's working.
I've also tried to paste it inside location / {} but it also not working.
Please help me.
Hello I am new to nginx and openresty. I am trying to dynamically route tcp connections. But content_by_lua_block doesn't seems to be working in tcp proxy_pass configuration however it worked with example http configuration.
But when i tried to add
set $target "127.0.0.1:7000";
It's working. I've also tried to paste it inside location / {} but it also not working. Please help me.