Issue with NGINX as reverse proxy with basic auth in front of Apache with basic auth

ssaravalli nginx-forum at
Thu Sep 1 14:19:57 UTC 2011

Igor Sysoev Wrote:
> You should
> 1) use either the same user/password on both nginx
> and Apache,

It's not possible in my situation. NGINX uses basic auth based on a
file, while Apache uses basic auth through LDAP.

> 2) or enable authentication only on one host: on
> nginx OR Apache,

I can't because I need two layer of authentication. The first one on
NGINX and the second one on the web apps with authentication based on
our LDAP server.

> 3) or enable authentication on nginx and go to
> Apache as some
>    backend user:
>     proxy_set_header   Authorization  
> base64_encoding_of_"user:password";

This is not my case.

So, is there a way to tell NGINX to manage only the first authentication
level and when the user provides username/password (LDAP) for the
backend web app, these credentials must be managed by the backend web

Another solution may be to keep on the backend the LDAP auth and on the
frontend (NGINX) a form based authentication?

Thanks, Simone Saravalli

Posted at Nginx Forum:,214550,214624#msg-214624

More information about the nginx mailing list