Hello!
On Sat, Jul 25, 2015 at 1:26 AM, <david.r...@enquora.com> wrote:
> I have an access_by_lua_file applied at the server level and now need to
> exclude certain locations. We are using basic authentication.
Well, you can just add the following stub
access_by_lua return;
to those locations you want to exclude to override the settings on the
server {} level.
> First attempt is setting 'auth_basic off;' in those location blocks and
> testing 'if ngx.var.auth_basic' in access_by_lua_file but this isn't
> working.
This won't work because the ngx_auth_basic module never exports any
builtin nginx variables, not to mention $auth_basic. See
http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html
I wonder where this $auth_basic thing comes from.
BTW, it's a generally a bad idea to use access_by_lua on the server {}
level since you have to be very careful about which locations to
exclude, including those used for "error_page" settings.
Regards,
-agentzh