Configure Apache to use external proxy for internet connection

apache-2.2PROXY

In my application I am using following rewrite rule:

RewriteRule ^/ajax(.*) http://api.externalserver.com/$1 [P,QSA,L]

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 http://api.externalserver.com/login

But this works:

curl -v -x 11.22.11.22:8585 http://api.externalserver.com/login

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

Best Answer

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

ProxyRemote * http://11.22.11.22:8585

somewhere in your virtualhost configuration.

Related Topic