# Proxy "apache like feature" RequestHeader unset authorization

**URL:** <https://www.ruby-forum.com/t/proxy-apache-like-feature-requestheader-unset-authorization/199977>\
**Category:** NGINX\
**Created:** [December 2, 2010, 9:28am UTC](https://www.ruby-forum.com/t/proxy-apache-like-feature-requestheader-unset-authorization/199977 "2010-12-02T09:28:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [December 2, 2010, 9:28am UTC](https://www.ruby-forum.com/t/proxy-apache-like-feature-requestheader-unset-authorization/199977/1 "2010-12-02T09:28:09Z")

</div>

Hello,

trying to setup Basic Authantication on a ningx reverse ssl to http  
proxy, where the backend doesn’t accept authentication.

now, nginx send the Authentication header to the upstream, and fails.

is there something like the apache feature “RequestHeader unset  
authorization” ??

Tried  
proxy\_hide\_header Authorization ;  
but it still sends that Authorization header to backend.

Any idea how to do that?

location /someplace {  
auth\_basic “Restricted”;  
auth\_basic\_user\_file /etc/apache2/Mypasswd ;

```
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Host $http_host;
       proxy_set_header X-FORWARDED_PROTO https;
       proxy_redirect off;
 proxy_hide_header Authorization ;
 proxy_pass http://someplace;

```

}

Regards,

–  
Arjan Filius  
[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Arjan\_Filius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@Arjan\_Filius](https://www.ruby-forum.com/u/Arjan_Filius)\
**Post date:** [December 2, 2010, 9:38am UTC](https://www.ruby-forum.com/t/proxy-apache-like-feature-requestheader-unset-authorization/199977/2 "2010-12-02T09:38:10Z")

</div>

On Thu, Dec 02, 2010 at 09:27:00AM +0100, Arjan Filius wrote:

> Tried  
> proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
> proxy\_set\_header Host $http\_host;  
> proxy\_set\_header X-FORWARDED\_PROTO https;  
> proxy\_redirect off;  
> proxy\_hide\_header Authorization ;

- 

```
 proxy_hide_header Authorization ;

```

- 

```
 proxy_set_header Authorization "";

```

> ```
> proxy_pass http://someplace;
> 
> ```
> 
> }

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**

---

<div class="post-metadata">

**Author:** ![Arjan\_Filius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@Arjan\_Filius](https://www.ruby-forum.com/u/Arjan_Filius)\
**Post date:** [December 2, 2010, 11:48am UTC](https://www.ruby-forum.com/t/proxy-apache-like-feature-requestheader-unset-authorization/199977/3 "2010-12-02T11:48:13Z")

</div>

Thanks! that worked

On Thu, 2 Dec 2010, Igor S. wrote:

> > authorization" ??
> > 
> > ```
> > proxy_pass http://someplace;
> > 
> > ```
> > 
> > }

–  
Arjan Filius  
[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
