Apache Proxy

As we all know, A Proxy server works as a gateway between you and Internet world. Proxy filters the content you are trying to see. When you are working behind a proxy server, content the you are trying to access is served through proxy. Proxy checks whether the content you are trying to get is approved or not, if your administrator has blocked something you will not be able to get that content. But this is just about an ordinary proxy server, which is most commonly implemented in an office environment.

Today we are talking about Apache proxy. Now you will be thinking what is a Apache proxy , what it does and how it is different then an ordinary proxy. May be some of you have heard this a very first time. But don’t worry i will explain it to you and will try to overcome your doubts.

Apache is not just limited to host webpages and handle all the web requests. It can also work as a proxy server just like any other proxy server. There are two types of apache proxy:

1] Forward Proxy
2] Reverse Proxy

A Forward proxy is an Intermediate server which makes communication between the Client and the Web server. Whenever client wants to browse any website , he/she enters the proxy’s IP and Port number in his browser. Client send the web request to forward proxy and forward proxy send it to the actual web server. When web server receives the request from forward proxy, it sends the content back to the forward proxy and further client receives the content from forward proxy.Forward proxy is basically used to provide Internet access to Internal network users. We just need to activate ‘ProxyRequests’ directive, but beware while enabling as it can be dangerous, as other can also use your server for illegal activity or send spams. So i will suggest you to not activate forward proxy until you know what you are doing and how you will manage it.

A Reverse proxy is also an Intermediate server which makes communication between the Client and the Web server.It is like a hidden proxy so client never know that when he is browsing the Internet, he is actually browsing through the reverse proxy. Reverse proxy can forward any web request to any other web site and the client will never know how all that happened. This is power of reverse proxy. Reverse proxy is basically used when you want to provide Internal website access to Internet world. Reverse proxy gives you the ability to hide the actual source website’s URL. You can enable reverse proxy by just enabling ‘ProxyPass’ directive.

Basic Example

Forward Proxy

ProxyRequests on
ProxyVia on
Order deny,allow
Deny from all
Allow from allowed-ip

Reverse Proxy

ProxyPass /fb http://www.facebook.com
ProxyPassReverse /fb http://www.facebook.com

Apache Proxy Modules

Following modules are required for apache proxy to work.

mod_proxy: Core module which manges the configuration and proxy requests.
mod_proxy_http: Fetches document with HTTP and HTTPS.
mod_proxy_ftp: Fetches document with FTP
mod_proxy_connect: Used to tunnel SSL requests through proxy server
mod_proxy_ajp: Provides support for the JServ protocol
mod_proxy_balancer: mod_proxy extension for load balancing
mod_cache, mod_disk_cache, mod_mem_cache: Manges document cache
mod_proxy_html: Rewrites HTML links into a proxy’s address space
mod_headers: Modifies HTTP request and response headers
mod_deflate: Negotiates compression with clients and backends.

Though above modules are pre-configured, but in case if they are not configured, you will have to install yourself. You can ignore caching if you are not very concerned about the performance.

In my next article i will tell you how to configure apache proxy on your server.

You can leave a response, or trackback from your own site.

3 Responses to “Apache Proxy”

  1. Ishita says:

    Nice article. I will wait for your next post on apache reverse proxy.

  2. Francesco says:

    Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I cant believe youre not more popular because you definitely have the gift.

  3. krishan says:

    Very nice articles sir i’ll wait your next apache web auth article..

Leave a Reply