nginx - Add exception for certain location within access_by_lua_block

115 views
Skip to first unread message

Nabeel Zafar

unread,
Feb 6, 2019, 9:25:47 AM2/6/19
to openresty-en
Hi,

I'm using access_by_lua_block within an nginx server block that contains many locations like so:

server {
    ...
    access_by_lua_block {
    }
  
    location / {
    }   
    location /myPath {
    }
    location /exceptionPath {
    }
    ...
}

How can I prevent access_by_lua_block from running for /exceptionPath? 

Thanks.

Nabeel Zafar

unread,
Feb 6, 2019, 9:49:53 AM2/6/19
to openresty-en
Actually doing the following seemed to work.. not sure if there's a better way?


server {
    ...
    access_by_lua_block {
    }
  
    location / {
    }   
    location /myPath {
    }
    location /exceptionPath {
      access_by_lua_block {
      }
    }
    ...
Reply all
Reply to author
Forward
0 new messages