Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

276
Views
Dynamic proxy_pass for stream

I'm trying to have openresty to reverse proxy TCP dynamicaly using lua.

For the start, I have :

    stream {
        server {
            listen     9291;
            set_by_lua_block $proxy '
                ngx.var.proxy = "10.128.128.3:8291"
            ';
            proxy_pass $proxy;
        }
    }

But openresty -t says:

nginx: [emerg] "set_by_lua_block" directive is not allowed here in /usr/local/openresty/nginx/conf/nginx.conf:129

I found many docs on dynamic proxy_pass, but all for 'http'.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Take a look at balancer_by_lua_block directive. You will need to use ngx.balancer API within balancer_by_lua_block.

Read all docs carefully. There are a lot of smart details. But all you need is here, just RTFM.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!