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

372
Views
How to add multiple access_by_lua_file directive under same location = /_sample

Using openidc module introspection under location and calling using below,

 Policy section
#
location = /_sample {
    internal;
    set $api_name "sample"; 
    access_by_lua_file /etc/nginx/path/oauth_introspection.lua;
     Proxypass......
}

Now i want to include below lua file to add some contents and validate something under the same request.

 Policy section
#
location = /_sample {
    internal;
    set $api_name "sample"; 
    access_by_lua_file /etc/nginx/path/oauth_introspection.lua;
        access_by_lua_file /etc/nginx/path/do_something.lua; //Error with duplicate
     Proxypass......
}

And my oauth_introspection.lua has this openidc introspect logic,

local res, err = require("resty.openidc").introspect(opts)
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

access_by_lua_file can be used only once. You must combine your code in lua file:

location = /_sample {
    internal;
    set $api_name "sample"; 
    access_by_lua_file /etc/nginx/path/action_sample.lua;
    Proxypass......
}

action_sample.lua:

local res, err = require("resty.openidc").introspect(opts)

-- do something or 
loadfile("/etc/nginx/path/do_something.lua")(opts)

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!