Welcome! Log In Create A New Profile

Advanced

auth_request and multiple sequential subrequests

Pavel Kolla
February 03, 2011 06:20AM
Thanks to Piotr & Maxim for helping with suppling proper headers along with
auth_requst!

Now I got a question about possibility to use auth_request in internal
subrequest similar to this:

location /t/
{
set $t 0;
auth_request /t1;
echo "base $t";
}

location /t1
{
# internal
auth_request /t2;
set $t 1;
echo "t1 $t";
}

location /t2
{
# internal
set $t 2;
return 403;
}

That doesn't really function as i expect and result in:

$ curl host/t/
base 1
$ curl -I host/t1
HTTP/1.1 403 Forbidden

(for sake of experiment I actually created the dirs so nginx doesn;t complain
with 404s on second request, but originally i had them as internal)

The main idea is to have 2 sequential checks where only success in both leads
to handling /t/, but each check can return different errors depending on
internal processing.

At this stage i'm not even sure if it is possible to use auth_request directive
in a subrequest, so i seek for wisdom here...


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

auth_request and multiple sequential subrequests

Pavel Kolla February 03, 2011 06:20AM

Re: auth_request and multiple sequential subrequests

agentzh February 13, 2011 11:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 292
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