Configure the Gateway as an HTTP Proxy

The following procedure describes how to configure the to behave as an HTTP proxy.
gateway91
The following procedure describes how to configure the
Layer7 API Gateway
to behave as an HTTP proxy.
To configure
Layer7 API Gateway
 as an HTTP proxy
:
  1. Publish a new XML service by completing the Publish Web API Wizard. Be sure to enter the following in Step 1 of the wizard:
    • Target URL
      : Enter "http://<
      yourHostName
      >
      ${request.http.uri}${request.url.query}
      " (without the quotes); for example:
      http://www.acmecorp.com${request.http.uri}${request.url.query}
    • Gateway URL
      : Enter "*" (asterisk, without the quotes)
  2. Open the properties of the newly published service. For more information, see Service Properties.
    • In the [
      HTTP/FTP
      ] tab select the
      HEAD
      check box.
  3. In your policy, add the Add Audit Detail assertion with these settings:
    • Message
      : Enter a message that includes the context variable ${
      request.ur
      l}. 
    • Level
      : Select WARNING from the drop-down list.
    This assertion will show the messages being processed successfully and will help you troubleshoot any issues.
  4. Locate the HOSTS file on the client machine and add a line for:
    <Gateway_IP> <hostname>
    Where:
    • <
      Gateway_IP
      > is the IP address of the 
      Layer7 API Gateway
    • <
      hostname
      > is the site to be browsed (i.e., "www.acmecorp.com")
      Only edit the HOSTS file on the client (web browsing) machine, not on the
      Layer7 API Gateway
      machine.
  5. Using your web browser, you can request the service using either the IP address of the
    Layer7 API Gateway
     or the hostname of the site to be browsed. Be sure to include the port number to properly process the requests—for example:
    • http://192.168.1.5:8080
      (where '192.168.1.5' represents the IP of the
      Layer7 API Gateway
      )
    • http://www.acmecorp.com:8080
      (where 'acmecorp' is the site mapped in step 4)