[Top] [Prev] [Next] [Last]
|
|
Chapter 4Proxy Service
Figure 4-1: A Proxy Server
Stronghold Web Server's proxy module can function in two modes:
- The default configuration allows any client to use the proxy to connect to any remote server. This is normal proxy service.
- A more sophisticated configuration allows Stronghold Web Server to act as a mirror that maps local URLs to remote servers.
When setting up the proxy, keep these guidelines in mind:
- When ProxyRequests is set to "on," Stronghold Web Server acts as a normal proxy server.
- When ProxyPass is set, Stronghold acts as a mirror proxy.
- When the cache directives on page 7-29 are set, Stronghold caches requested files.
- When SSLFlag is set to "on," the proxy encrypts all transactions on the client side. Netscape Navigator and Microsoft Internet Explorer do not support client-side SSL/TLS transactions except with a mirror proxy configured with ProxyPass.
- When the proxy's SSL/TLS port is redirected to a nonsecure port with ProxyPass, client-side transactions are encrypted and server-side transactions are not.
- When the proxy's nonsecure port is redirected to an SSL/TLS port with ProxyPass, server-side transactions are encrypted and client-side transactions are not.
This chapter shows you how configure the proxy and activate caching, then explains how to set up
- a mirror proxy
- an HTTP-to-SSL/TLS proxy
- an SSL/TLS-to-HTTP proxy on one platforrm
- an SSL/TLS-to-HTTP proxy on two platforms
- an SSL/TLS-to-SSL/TLS proxy
This configuration works when both clients and remote servers support SSL or TLS.
- a proxy to other proxies
This configuration passes proxy requests to other proxy servers.
Configuring the Proxy Server
In order to enable normal proxy service, you only need to have ProxyRequests set to "on." This section shows you how to configure caching and mirror proxy service.
To configure the proxy once it is enabled, use this special container:
<Directory proxy:*>
. . .
</Directory>
<Directory proxy:*>
AuthType Basic
AuthUserFile ServerRoot/proxy/.htpasswd
AuthName Proxy
require valid-user
</Directory>
<Directory proxy:http://www.c2.net/>
<Directory proxy:http:*>
. . .
</Directory>
<Directory proxy:https:*>
. . .
</Directory>
<Directory ~ proxy:http://[^:/]+:80/.*>
. . .
</Directory>
<Directory ~ proxy:http://[^:/]+/.*>
. . .
</Directory>
Similar containers denote the default SSL/TLS port:
<Directory ~ proxy:https://[^:/]+:443/.*>
. . .
</Directory>
<Directory ~ proxy:https://[^:/]+/.*>
. . .
</Directory>
<VirtualHost proxy.host.com:*>
. . .
</VirtualHost>
Caching
The cache directives, described in more detail in "Proxy Service and Caching" on page 7-29, are as follows:
In order to disable caching, you can
- remove all cache directives from httpd.conf or
- set NoCache to "*"
Configuring a Mirror Proxy
For example, C2Net's main server configuration includes this line:
ProxyPass /apache/ http://www.apache.org/
<VirtualHost apache.c2.net:80>
ProxyPass / http://www.apache.org/
</VirtualHost>
<VirtualHost apache.c2.net:443>
SSLFlag on
ProxyPass / http://www.apache.org/
</VirtualHost>
Proxying to Other Proxies
Since the proxy module is currently limited to HTTP/1.0, FTP, and CONNECT, you may want to set another proxy to handle requests for other protocols, such as GOPHER. Instead of instructing users to set different proxies for different protocols, you can configure Stronghold Web Server to contact other proxies for requests it cannot fulfill. Users can then direct all requests to Stronghold Web Server. To do this, you can use the ProxyRemote directive in a variety of ways:
ProxyRemote gopher http://www.proxy.net/
ProxyRemote *://www.emi.com https://www.proxy.com/
ProxyRemote * http://transend.cs.berkeley.edu:4444/
- In the first instance, Stronghold redirects all GOPHER requests to http://www.proxy.net, a proxy server that supports GOPHER.
- In the second instance, requests for one URL using any protocol are redirected to an appropriate proxy using SSL or TLS.
- In the third instance, all requests are redirected to a server that implements methods of bandwidth optimization in order to streamline server responses. This option can be also be useful if you need to chain several proxy servers to penetrate layers of firewalls.
NOTE: Because ProxyRemote only supports HTTP, all requests and responses that follow other protocols are HTTP-encapsulated. The other proxies that Stronghold Web Server connects to must support the HTTP proxy scheme.
You can also block sites to prevent users from accessing them through the proxy server. The ProxyBlock directive lets you specify a space-separated list of hosts, domains, or URI keywords that the proxy server blocks. For example:
ProxyBlock www.solidoak.com cyberpatrol.com censored
You can also use this directive to block access to all sites, like this:
ProxyBlock *
You can achieve a similar effect by setting ProxyRequests to "off."
Examples
- an HTTP-to-SSL/TLS proxy
- an SSL/TLS-to-HTTP proxy on one platforrm
- an SSL/TLS-to-HTTP proxy on two platforms
- an SSL/TLS-to-SSL/TLS proxy
An HTTP-to-SSL/TLS Proxy
Figure 4-2: HTTP-to-SSL/TLS Proxy
<Directory proxy:http:*>
order allow,deny
allow from none
deny from all
</Directory>
An SSL/TLS-to-HTTP Proxy on One Platform
- confined to the same hardware platform where Stronghold resides or
- confined to a local network
NOTE: An SSL/TLS proxy to a nonsecure server over the Internet can provide anonymity, but not data security.
Figure 4-3: SSL/TLS-to-HTTP Proxy on a Unified Platform
While the unsecured server listens on port 80, the proxy can handle all transactions on port 443:
Port 443
Listen 443
SSLFlag on
ProxyRequests On
ProxyPass / http://unsecured.host.com/
You can add a similar <VirtualHost> container for each virtual host on the nonsecure server:
<VirtualHost 1.host.com>
ProxyPass / http://1.host.com/
</VirtualHost>
<VirtualHost 2.host.com>
ProxyPass / http://2.host.com/
</VirtualHost>
An SSL/TLS-to-HTTP Proxy on Separate Platforms
- confined to a local network or
- confined to the same hardware platform where Stronghold resides
NOTE: An SSL/TLS proxy to a nonsecure server on the Internet can provide anonymity, but not data security.
- disassociate the unsecured server's hostname from its IP number, then
- associate it with the Stronghold Web Server platform's IP number.
Figure 4-4: SSL/TLS-to-HTTP Proxy to a Separate Platform
Listen 80
Listen 443
ProxyRequests On
<VirtualHost unsecured.host.com:80>
ProxyPass / http://117.120.36.10/
</VirtualHost>
<VirtualHost unsecured.host.com:443>
SSLFlag on
ProxyPass / http://117.120.36.10/
</VirtualHost>
An SSL/TLS-to-SSL/TLS Proxy
NOTE: Netscape Navigator and Microsoft Internet Explorer do not support SSL/TLS transactions to proxy servers. Even if all clients on your internal network support SSL/TLS to proxies, they will not have access to servers that do not support SSL/TLS.
To accomplish this, you can enable proxy service only on the SSL/TLS port
<VirtualHost _default_:443>
ProxyRequests on
SSLFlag on
</VirtualHost>
[Top] [Prev] [Next] [Last]
© 1998 C2Net International
Feedback: stronghold-docs@c2.net![]()