Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to configure Apache on Centos 6 to proxy and reverse proxy traffic to an http server of a third party provider.

The setup should work like this: https://mydomain.com/proxy/ proxies all trafic transparently to http://thirdparty.com/app/

The issue I'm having is any request made to https://mydomain.com/proxy/ gets a 301 redirect in response.

These are all of the proxy related options in my VirtualHost

SetOutputFilter proxy-html
ProxyHTMLExtended On
ProxyRequests Off
SSLProxyEngine On

<Proxy *>
Order deny,allow
Allow from all
</Proxy>


ProxyPass /proxy/ http://thirdparty.com/app/
<Location /proxy/>
        ProxyPassReverse /
        ProxyHTMLEnable On
        ProxyHTMLURLMap http://thirdparty.com/app/ /proxy/
        ProxyHTMLURLMap / /proxy/
</Location>
share|improve this question

1 Answer 1

up vote 4 down vote accepted

We have a similar setup and are using this (of course you need to load before mod_proxy, mod_ssl and mod_proy_http):

ProxyRequests Off
SSLProxyEngine On

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>


ProxyPass /proxy/ http://thirdparty.com/app/
ProxyPassReverse /proxy/ http://thirdparty.com/app/
<Location /proxy/>
  ProxyPassReverse /
  Order deny,allow
  Allow from all     
</Location>
Header edit Location ^http://thirdparty.com/app/ https://thirdparty.com/app/
share|improve this answer
    
I found one bug in that I was using thirdparty.com which redirects to thirdparty.com. However my original configuration did not work with this either, yours did. Thanks. –  james_t Mar 8 '13 at 18:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.