Author |
|
hschmale
Joined: 23 Jun 2016 Posts: 3 Location: USA, Harrisburg
|
Posted: Thu 23 Jun '16 21:16 Post subject: Apache strips Authorization Basic Header |
|
|
I have apache setup as a proxy for multiple websites, and it works fine for this. However, one of the sites needs to have the Authorization and HTTP authenication headers for it to work. How can I keep apache from stripping those headers when passing the request onto the target?
I need those headers for owncloud's webdav system to work. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
|
Back to top |
|
hschmale
Joined: 23 Jun 2016 Posts: 3 Location: USA, Harrisburg
|
Posted: Mon 27 Jun '16 19:42 Post subject: |
|
|
Could you supply a minimum working example of proxying using proxy-chain-auth? My current sample looks like the below.
Code: |
ProxyPreserveHost On
ProxyPass / https://192.168.122.104/
ProxyPassReverse / https://192.168.122.104/
|
|
|
Back to top |
|
hschmale
Joined: 23 Jun 2016 Posts: 3 Location: USA, Harrisburg
|
Posted: Mon 27 Jun '16 21:35 Post subject: Solved it |
|
|
Code: |
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
Apparently if you apply this rewrite rule at the proxy, it will pass along the headers. |
|
Back to top |
|
tallandtree
Joined: 31 Mar 2016 Posts: 4 Location: NL
|
Posted: Mon 25 Jul '16 17:26 Post subject: Re: Solved it |
|
|
hschmale wrote: | Code: |
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
Apparently if you apply this rewrite rule at the proxy, it will pass along the headers. |
I've got the same issue, but in my case the RewriteRule doesn't help. Still having to login at about every click.
Code: |
<VirtualHost *:80>
ServerName myserver.company.com
ServerAdmin admin@company.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /error/ !
<Proxy *>
SetEnv proxy-chain-auth On
SetEnv proxy-sendcl On
AuthBasicAuthoritative Off
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</Proxy>
ProxyPass / http://servera.company.com/
ProxyPassReverse / http://servera.company.com/
</VirtualHost>
|
Do you have any other relevant code in your conf? |
|
Back to top |
|
tallandtree
Joined: 31 Mar 2016 Posts: 4 Location: NL
|
Posted: Thu 28 Jul '16 10:45 Post subject: Re: Solved it |
|
|
Note that I was not able to solve this in Apache 2.4. With Apache 2.2 it works without any issues though. Digging through the tcpdumps of both versions did not make me any wiser why it did not work with apache 2.4. Hope someone is able to explain how to do this in Apache 2.4.
Working configuration in Apache 2.2:
Code: | # Virtual Hosts
<VirtualHost *:80>
ServerName myserver.domain.org
ServerAdmin admin@domain.org
ProxyRequests off
ProxyPreserveHost on
KeepAlive On
ProxyPass /error/ !
<Proxy *>
SetEnv proxy-initial-not-pooled 1
</Proxy>
ProxyPass / http://myserver.domain.org/
ProxyPassReverse / http://myserver.domain.org/
</VirtualHost>
|
|
|
Back to top |
|