auth_basic and such is not allowed under “if” … trying to figure out
some way to dynamically do this.
I think if you put the if() inside the server rather than inside a
location it should work.
You can jump to named location inside if statement, and change
authorization
configuration there.
2010 12 4 00:05 пользователь “Michael S.” [email protected]
написал:
You can jump to named location inside if statement, and change authorization
configuration there.
So are you saying something like
if ($http_via ~* “.somehost.net”) {
rewrite @protected permanent;
}
location @protected {
auth_basic etc.
}
wouldn’t I have to define the entire location / twice then? once inside of that named location (because I need the entire base
location and such to be active, just behind auth)
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.
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.
Since it isn’t important enough to compile in lua just for this, I
wouldn’t have really considered this an option anyway.
But yes, I believe you’re still right. It still all relies on nginx
allowing variables. That could be as simple as a two line patch or
could be complex. I don’t know?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.