user authentication with nginx

Jonathan Matthews contact at
Sun Aug 19 22:24:19 UTC 2012

On 19 August 2012 22:32, Bob Stanton <farseas at> wrote:
> I want to find a secure but simple method for authenticating users in an
> Nginx environment.
> I have succeeded in figuring out the auth_basic mod but that does not meet
> my needs.
> I specifically want to supply my own form, get the username and PW, check it
> against my DB with a CGI program, and then pass values back to Nginx.

Use proxy_pass ( or fastcgi_pass
( to communicate the Auth headers to
your daemon, which should then respond with whatever page you want
your users to see in the event of auth success or failure.

There are many configuration examples for these on the interwebs.

Jonathan Matthews
Oxford, London, UK

More information about the nginx mailing list