1

I'm running Red Hat Enterprise Linux 6 with Apache 2.2. How do I configure Apache to use the system HTTP proxy (internal company proxy)? I keep getting 'Connection refused' errors when trying to reverse proxy to external addresses (outside the company firewall).

So far I've tried the following:

Add the below to the httpd.conf file (with the actual credentials and proxy server details):

SetEnv http_proxy http://username:password@proxy:port

I've tried adding the below to /etc/profile, /root/.bash_profile, /root/.profile, /var/www/.profile and /var/www/.bash_profile:

http_proxy http://username:password@proxy:port
export http_proxy

I've also verified that the http_proxy values are correct by performing a

wget www.google.com

from the root shell.

I should add that my ultimate goal is to reverse proxy all local /utag/* URL's to http://tags.tiqcdn.com/utag/* via the internal company HTTP proxy.

0

I do not think this is possible. I think your only bet would be to get a Squid installation working as a transparent proxy and then put Apache to send the requests to that one.

EDIT:

I resolved this using ProxyRemote (with accompanying ProxyPass statements). On Apache 2.2 this doesn't work with username/password without a patch, but I managed to get company proxy access that grants access by IP instead of requiring user credentials. – rudolfv 17 mins ago

4
  • Sorry, I think I did not state my issue clearly. We already have an internal company proxy. I want to reverse proxy all /utag/* requests via the internal company proxy to tags.tiqcdn.com/utag*. My issue is getting apache to perform requests via the internal company proxy.
    – rudolfv
    Apr 16 '14 at 7:42
  • I did understand and answer. That proxy must run in transparent mode and when you proxy_pass to it, just make sure that Apache sends the right Host header and path. Apr 16 '14 at 7:57
  • I resolved this using ProxyRemote (with accompanying ProxyPass statements). On Apache 2.2 this doesn't work with username/password without a patch, but I managed to get company proxy access that grants access by IP instead of requiring user credentials.
    – rudolfv
    Apr 16 '14 at 9:32
  • mind sharing an example of the httpd.conf file with the proxypass/proxyremote statements?
    – Fanchi
    Jan 19 '17 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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