log_subrequest and auth_request

Maxim Dounin mdounin at mdounin.ru
Thu Nov 5 17:33:13 UTC 2015


Hello!

On Mon, Nov 02, 2015 at 05:37:00PM -0500, jstangroome wrote:

> Hi,
> 
> I have set `log_subrequest on;` at the http level and I am using to
> `auth_request` to a location that does a `proxy_pass` but I am not seeing
> the details of the auth subrequest in the access.log. Should this work?
> 
> Conf:
> 
> > log_subrequest on;
> > server{
> >   location / {
> >     auth_request /authorize;
> >     # ...
> >   }
> >   location /authorize {
> >     proxy_pass http://authserver/doauth;
> >   }
> > }

Works fine here.  Note though, that with default logging format 
(with $request, see http://nginx.org/r/log_format) is mostly 
impossible to distinguish a subrequest from the main request, as 
$request will be identical for both.  You have to log $uri to see 
the difference.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list