™

Administrator's Guide

Explicit Proxy Caching

If you want to use Traffic Server as an explicit proxy cache, you must configure client software (i.e., browsers) to send requests directly to Traffic Server.

Explicit Proxy Caching for HTTP

If you do not configure Traffic Server to use the transparency option (with which client requests are intercepted en route to origin servers by a switch/router and rerouted to the Traffic Server machine), then clients must configure their web browsers to send HTTP requests to the Traffic Server proxy cache by configuring their browsers to download proxy configuration instructions from a PAC file (Proxy Auto-Configuration file).

Configuring Browsers Manually

To manually configure a browser to send HTTP requests to Traffic Server, clients must provide the following information:

  • The fully-qualified hostname or IP address of the Traffic Server node
  • The Traffic Server proxy server port (port 8080)

In addition, clients can specify not to use Traffic Server for certain sites - in such cases, requests to the listed sites go directly to the origin server. The procedures for manual configuration vary among browser versions; refer to specific browser documentation for complete proxy configuration instructions. You do not need to set any special configuration options on Traffic Server if you want to accept requests from manually-configured browsers.

Using a PAC File

A PAC file is a specialized JavaScript function definition that a browser calls to determine how requests are handled. Clients must specify (in their browser settings) the URL from which the PAC file is loaded. You can store a PAC file on Traffic Server (or on any server in your network) and then provide the URL for this file to your clients.

If you want to store a PAC file on the Traffic Server system, then you must perform the following configuration:

  • Either copy an existing PAC file into the Traffic Server config directory or enter a script that defines the proxy server configuration settings in the proxy.pac file provided (the file is empty by default).
  • Specify the port Traffic Server uses to serve the PAC file. The default port is 8083.
Configure Traffic Server to provide a PAC file manually:
  1. If you have an existing PAC file, then replace the proxy.pac file located in the Traffic Server config directory with the existing file.
  2. In a text editor, open the records.config file located in the Traffic Server config directory.
  3. Edit the following variable:
  4. Variable Description
    proxy.config.admin.autoconf_port

    Set this variable to specify the port Traffic Server uses to serve the PAC file. The default port is 8083.

  5. Save and close the records.config file.
  6. In a text editor, open the proxy.pac file located in the Traffic Server config directory.
    • If you copied an existing PAC file into the Traffic Server config directory, then the proxy.pac file contains your proxy configuration settings. Check the settings and make changes if necessary.
    • If you did not copy an existing PAC file into the Traffic Server config directory, then the proxy.pac file is empty. Enter a script that will provide the proxy server configuration settings. A sample script is provided in Sample PAC File.
  7. Save and close the proxy.pac file.
  8. Restart Traffic Server.
  9. Inform your users to set their browsers to point to this PAC file; click here for browser settings.

Sample PAC File

The following sample PAC file instructs browsers to connect directly to all hosts without a fully-qualified domain name and to all hosts in the local domain. All other requests go to the Traffic Server named myproxy.company.com.

function FindProxyForURL(url, host) 
{
if (isPlainHostName(host)) ||
(localHostOrDomainIs(host, ".company.com")) {
return "DIRECT";
}
else
return "PROXY myproxy.company.com:8080;" +
"DIRECT";
}

 

 

  • Overview
  • Getting Started
  • HTTP Proxy Caching
  • Explicit Proxy Caching
  • Reverse Proxy and HTTP Redirects
  • Hierarchical Caching
  • Configuring the Cache
  • Monitoring Traffic
  • Configuring Traffic Server
  • Security Options
  • Working with Log Files
  • Traffic Line Commands
  • Event Logging Formats
  • Configuration Files
  • Traffic Server Error Messages
  • FAQ and Troubleshooting Tips
  • Traffic Server 管理员指南 (PDF)
Copyright © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0. Apache Traffic Server, Apache, the Apache Traffic Server logo, and the Apache feather logo are trademarks of The Apache Software Foundation.