# Auth request module header passing

**URL:** <https://www.ruby-forum.com/t/auth-request-module-header-passing/222490>\
**Category:** NGINX\
**Created:** [August 30, 2012, 9:47am UTC](https://www.ruby-forum.com/t/auth-request-module-header-passing/222490 "2012-08-30T09:47:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 30, 2012, 9:47am UTC](https://www.ruby-forum.com/t/auth-request-module-header-passing/222490/1 "2012-08-30T09:47:14Z")

</div>

Hi Maxim,  
Many thanks to your work!

I am using auth req module and have experienced the following problem  
(issue).  
I can’t get the headers to be passed to auth backend from initial  
request.

location /initial {  
auth\_request /auth  
}

location /auth {  
proxy\_pass ;  
proxy\_set\_header X-Header $http\_x\_header\_from\_request;  
}

Unfortunately, auth service does not receive the X-header.  
Do I understand correct that auth\_req module does not receive headers  
from  
initial request?

Thanks in advance,  
Oleksiy

Posted at Nginx Forum:

> **[Auth request module header passing](https://forum.nginx.org/read.php?2,230313,230313#msg-230313)**
>
> Hi Maxim, Many thanks to your work! I am using auth req module and have experienced the following problem (issue). I can't get the headers to be passed to auth backend from initial request. location /initial { auth\_request /auth }

---

<div class="post-metadata">

**Author:** ![mokriy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@mokriy](https://www.ruby-forum.com/u/mokriy)\
**Post date:** [August 30, 2012, 12:31pm UTC](https://www.ruby-forum.com/t/auth-request-module-header-passing/222490/2 "2012-08-30T12:31:31Z")

</div>

It works,  
you have to put header in quotes:  
“$http\_x\_header\_from\_request”

Posted at Nginx Forum:

> **[Re: Auth request module header passing](https://forum.nginx.org/read.php?2,230313,230324#msg-230324)**
>
> Hi Maxim, Many thanks to your work! I am using auth req module and have experienced the following problem (issue). I can't get the headers to be passed to auth backend from initial request. location /initial { auth\_request /auth }

---

<div class="post-metadata">

**Author:** ![mokriy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@mokriy](https://www.ruby-forum.com/u/mokriy)\
**Post date:** [August 31, 2012, 8:22pm UTC](https://www.ruby-forum.com/t/auth-request-module-header-passing/222490/3 "2012-08-31T20:22:56Z")

</div>

Hello mokriy,

Are you using the perl script that Maxim included with auth\_request or  
are  
you doing it some other way?

I am working to setup auth\_request using my own form and with a CGI  
program  
in C but I would be very interested in what you are doing.

What does “” represent in your nginx.conf?

Thank you both very much.
