Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my application I am using following rewrite rule:

RewriteRule ^/ajax(.*)$1 [P,QSA,L]

You know what it does.

Now the problem is that my corporate network requires me to use HTTP proxy for external internet connections.

To ilustrate, this doesn't work:

curl -v

But this works:

curl -v -x

How can I make Apache use the corporate proxy for external internet requests?

share|improve this question
up vote 7 down vote accepted

I think you'll want to enable mod_proxy_http, and set:

ProxyRemote *

somewhere in your virtualhost configuration.

share|improve this answer
where do I have to set this? – becko Oct 16 '15 at 17:08
where is mod_proxy_http?! – Mr.Hyde Jun 1 at 12:42

Did you try http tunneling, via proxytunnel or corkscrew ?

You need to configure a vhost for your Apache and use it as a distant proxy.

Maybe adapting this could help you :

share|improve this answer

I think what you are looking for is mod_proxy, and mod_proxy_http specifically:

share|improve this answer

You may install SQUID proxy in transparent mode to proxy all traffic going from local machine to the internet.

For this first add iptables rule

iptables -t nat -A OUTPUT -p tcp --dport 5555 -j DNAT --to

this will redirect all outgoing http connections to local squid. Then configure squid according to this guide and additionaly configure

cache_peer parent 8585 0 no-query default
never_direct allow all

That's all. All your outgoing traffic to port 80 will go through your organisation proxy

share|improve this answer

After setting ProxyRemote and restarted httpd, if you got the "[error] (13)Permission denied: proxy: HTTP: attempt to connect to failed", then you also need to execute the following:

setsebool -P httpd_can_network_connect=1
share|improve this answer

Your Answer


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.