Previous Section
 < Day Day Up > 
Next Section


Web Server Acceleration: Reverse Proxy Cache

Though Squid caches can enhance access by clients to a Web server, Squid can also reduce the load on a Web server. Web servers that become overwhelmed by requests can move their cacheable pages to a Squid proxy server that can serve as a kind of alternate site, handling requests for those pages. In effect, the Web server becomes accelerated. Such a cache is known as a reverse proxy cache, focusing on the server instead of the client. A reverse proxy cache will intercept requests to a server, processing any for its cached pages. Only requests for noncached pages are forwarded to the original Web server.

To configure a reverse proxy cache, you use the httpd_accel directives. httpd_accel_ host specifies the address of the original Web server, and httpd_accel_port is the port it uses. If the proxy supports only one Web server, you set httpd_acel_single_host to on, whereas if the proxy is supporting several Web servers, set it to off. If you want to use the proxy server both as a proxy for clients and as a reverse proxy for the Web server, you set the httpd_accel_with_proxy option to on. However, clients would then need to configure their browsers to access the Web server, as they would to access any standard proxy server. The httpd_accel_uses_host_header directive is used to implement transparent caches; it should be turned off for reverse proxy caches.

http_port 80 # Port of Squid proxy
httpd_accel_host 172.16.1.115 # IP address of web server
httpd_accel_port 80 # Port of web server
httpd_accel_single_host on # Forward uncached requests to host
httpd_accel_with_proxy on #
httpd_accel_uses_host_header off

If your Squid proxy server and the Web server are operating on the same host, you need to specify the port that the Web server is using. This cannot be the same port as Squid is using. In the following example, the Web server is using port 81, whereas Squid is using port 80.

http_port 80 # Port of Squid proxy
httpd_accel_host localhost # IP address of web server
httpd_accel_port 81 # Port of web server

In addition, DNS entries for the external network would use the IP address of the proxy server for the Web server host name, directing all the Web server requests to the proxy server. DNS entries for the internal network would use the Web server's IP address for the Web server host name, allowing the proxy to redirect noncached requests onto the Web server. If your network uses only one DNS server, you can set up a Split DNS server to specify internal and external addresses (see Chapter 34).



Previous Section
 < Day Day Up > 
Next Section
This HTML Help has been published using the chm2web software.