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.

rudolfv
  • 113
  • 1
  • 5

1 Answers1

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

Florin Asăvoaie
  • 7,057
  • 23
  • 35
  • 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 http://tags.tiqcdn.com/utag/*. My issue is getting apache to perform requests via the internal company proxy. – rudolfv Apr 16 '14 at 07: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. – Florin Asăvoaie Apr 16 '14 at 07: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 09:32
  • mind sharing an example of the httpd.conf file with the proxypass/proxyremote statements? – Fanchi Jan 19 '17 at 08:09