Welcome! Log In Create A New Profile

Advanced

Re: Pre-process request via upstream then forward to proxy.

Maxim Dounin
May 05, 2011 02:32AM
Hello!

On Thu, May 05, 2011 at 12:11:30AM -0400, AndrewH wrote:

> As part of processing a request, I need to first send and receive a
> response to/from an upstream to authenticate some credentials in the
> request. Once this has been done, the original request needs to be
> proxied to another upstream.
>
> According to Evan Miller's tutorial, the only valid location for
> spawning sub-requests is in an output filter ie. to post-process a
> response. So it appears that this approach is useful for massaging a
> reponse but not valid for actually performing pre-processing on a
> request.

Evan Miller's claim was correct before 0.7.25. In recent versions
you may issue subrequests almost everywhere. There are some
caveats though - it's up to you to take appropriate measures to
ensure subrequest response won't appear on client's connection.

> Does anyone know what the sanctioned way of going about this in NGINX
> is? Or which existing modules/examples implement similar
> functionality?

Take a look at:

http://grid.net.ru/nginx/eval.en.html
http://mdounin.ru/hg/ngx_http_auth_request_module/

Maxim Dounin

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

Pre-process request via upstream then forward to proxy.

AndrewH May 05, 2011 12:11AM

Re: Pre-process request via upstream then forward to proxy.

agentzh May 05, 2011 02:12AM

Re: Pre-process request via upstream then forward to proxy.

Maxim Dounin May 05, 2011 02:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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