Welcome! Log In Create A New Profile

Advanced

Re: Conditional http auth

December 04, 2010 10:46AM
Hi,

On 04/12/2010 13:18, agentzh wrote:
> With the ngx_lua [1] module enabled, it's trivial:
>
> set_by_lua $realm '
> if string.match(ngx.var.http_via, ".somehost.net") then
> return "off"
> else
> return "enter your password"
> end';
>
> auth_basic $realm;
> auth_basic_user_file /etc/nginx/confs/htpasswd.test;
>
> This should have great performance even if you're using Lua ;)
I've not tested it, but I had a quick look at the code and it appears
that auth_basic doesn't accept variables (yet), so regardless of the
setting mechanism, I don't think it will work.

Adding variable support to auth_basic, though, could be useful it seems.

Cheers,

Marcus.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Conditional http auth

mike December 03, 2010 03:58PM

Re: Conditional http auth

Eugaia December 03, 2010 04:06PM

Re: Conditional http auth

mike December 03, 2010 04:08PM

Re: Conditional http auth

Boris Dolgov December 03, 2010 04:10PM

Re: Conditional http auth

mike December 03, 2010 04:14PM

Re: Conditional http auth

mike December 03, 2010 05:10PM

Re: Conditional http auth

Eugaia December 03, 2010 04:26PM

Re: Conditional http auth

agentzh December 04, 2010 06:24AM

Re: Conditional http auth

agentzh December 04, 2010 06:28AM

Re: Conditional http auth

Eugaia December 04, 2010 10:46AM

Re: Conditional http auth

mike December 04, 2010 06:04PM

Re: Conditional http auth

mike December 06, 2010 07:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 306
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready