Sun Java System Web Server 7.0 Administrator's Guide

Configuring Reverse Proxy

A reverse proxy is a proxy that appears to be a web server (origin server) to clients but in reality forwards the requests it receives to one or more origin servers. Because a reverse proxy presents itself as an origin server, clients do not need to be configured to use a reverse proxy. By configuring a given reverse proxy to forward requests to multiple similarly configured origin servers, a reverse proxy can operate as an application level software load balancer.


Note –

In a typical deployment one or more reverse proxies will be deployed between the browsers and the origin servers.


ProcedureTo Add a Proxy URI

  1. Click on Configurations tab and select the configuration.

  2. Click Virtual Servers tab and select the virtual server.

  3. Click Content Handling > Reverse Proxy tab.

  4. Click New Proxy URI button.

    Specify values for the following parameters:

    • URI — The reverse proxy URI

    • Server URL — Comma separated URLs of the remote server. If multiple values are given, the server will distribute load among the specified servers.

ProcedureTo Modify the Reverse Proxy Parameters

  1. Click on Configurations tab and select the configuration.

  2. Click Virtual Servers tab and select the virtual server.

  3. Click Content Handling > Reverse Proxy tab.

  4. Click URI

    You can edit the following parameters:

    • URI — The reverse proxy URI

    • Server URL — Comma separated URLs of the remote server. If multiple values are given, the server will distribute load among the specified servers.

    • Sticky Cookie — Name of a cookie that when present in a response, will cause subsequent requests to stick to that origin server.

    • Sticky URI Parameter — Name of a URI parameter to inspect for route information. When the URI parameter is present in a request URI and its value contains a colon `:' followed by a route ID, the request will "stick" to the origin server identified by that route ID.

    • Route Header — Name of the HTTP request header used to communicate route IDs to origin servers.

    • Route Cookie — Name of the cookie generated by the server when it encounters a sticky-cookie cookie in a response. The route-cookie cookie stores a route ID that enables the server to direct subsequent requests back to the same origin server.


    Note –

    Using CLI

    1. Invoke create-reverse-proxy command.


    wadm> create-reverse-proxy --user=admin --password-file=admin.pwd 
    --host=serverhost --port=8989 --config=test --vs=test --uri-prefix=// 
    --server=http://rick.india.sun.com:8080

    See CLI Reference, create-reverse-proxy(1).

    2. Modify obj.conf file.


    NameTrans fn="map" from="/" name="reverse-proxy-/" to="http:/"
    ...
    <Object name="reverse-proxy-/">
    Route fn="set-origin-server" server="http://rick.india.sun.com:8080"
    </Object>
    
    <Object ppath="http:*">
    Service fn="proxy-retrieve" method="*"
    </Object>

    For redirecting to a secure site, follow the same step and provide the https address for --server option.