# LDAP + Header Rewrite

**URL:** <https://www.ruby-forum.com/t/ldap-header-rewrite/235723>\
**Category:** NGINX\
**Created:** [July 11, 2013, 11:45am UTC](https://www.ruby-forum.com/t/ldap-header-rewrite/235723 "2013-07-11T11:45:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [July 11, 2013, 11:45am UTC](https://www.ruby-forum.com/t/ldap-header-rewrite/235723/1 "2013-07-11T11:45:52Z")

</div>

We have been looking around for a while on this one without luck so I  
figured I would see if anyone here might have an idea. Nginx seems to be  
able to do everything if you can just figure out how 🙂

We are trying to use nginx as a reverse proxy / trusted intermediary for  
authentication. We would like to have nginx authenticate via LDAP for us  
and  
then add a header to the request representing the authenticated user and  
the  
groups they belong to eg:

“TrustedIntermediaryUserInformation: greg; admins, all, users”

We have LDAP authentication working and we have nginx working as a pass  
through. We are just unsure of how to get the information from the LDAP  
module to add the header.

Thanks in advance,

Greg

Posted at Nginx Forum:

> **[LDAP + Header Rewrite](https://forum.nginx.org/read.php?2,240752,240752#msg-240752)**
>
> We have been looking around for a while on this one without luck so I figured I would see if anyone here might have an idea. Nginx seems to be able to do everything if you can just figure out how :) We are trying to use nginx as a reverse proxy /...

---

<div class="post-metadata">

**Author:** ![GregYoung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ed8c4c/32.png) [@GregYoung](https://www.ruby-forum.com/u/GregYoung)\
**Post date:** [July 12, 2013, 12:09am UTC](https://www.ruby-forum.com/t/ldap-header-rewrite/235723/2 "2013-07-12T00:09:40Z")

</div>

On Thu, Jul 11, 2013 at 05:45:15AM -0400, GregYoung wrote:

Hi there,

> We have LDAP authentication working and we have nginx working as a pass  
> through. We are just unsure of how to get the information from the LDAP  
> module to add the header.

Which ldap module is that?

And what does its documentation say?

I’d imagine that the information you want would be available in  
variables,  
possibly including $remote\_user, if it is available at all.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
