Implementing server portals for a Reverse Proxy.
You want help implementing server portals
How do I set up a two way URL rewrite (TWURL)?
In the section on "Transformer Definition" in the below linked "SGOS Policy Best Practice Guide", find the following explanation of the "url_rewrite" definition:
SGOS Policy Best Practice Guide
A url_rewrite definition defines rule for rewriting URLs in HTTP responses. The URLs are either embedded in tags within
HTML, CCS, JavaScript, or ASX documents, or they are contained in HTTP response headers. In addition to rewriting
URLs, you can also rewrite arbitrary JavaScript.This transformer takes effect only if it is also invoked by a transform action in a define action definition block, and that block
is in turn called from an action() property.For each URL found within an HTTP response, a url_rewrite transformer first converts the URL into absolute form, then
finds the first rewrite_url_substring or rewrite_url_prefix statement whose server_URL_substring matches the
URL being considered. If such a match is found, then that substring is replaced by the client_url_substring.
The visual policy manager (VPM) has not support for TWURL; you will have to use CPL.
A server portal provides controlled access to a web server or a collection of web servers.
When a ProxySG is configured as a server portal, it performs two-way URL rewrite between a set of client URLs and a set of server URLs. The client URLs are the ones used by client workstations to access web pages behind the portal. The server URLs are the ones understood by the web servers behind the portal.
When the ProxySG receives a request from a client for a web page that is inside a server portal, it rewrites the requested URL from client form to server form, then it sends the rewritten request to the server. When the server sends back a response, the ProxySG rewrites URLs inside the response from server form back to client form.
When you set up a server portal, you must decide what the client URLs look like, and what the corresponding server URLs look like. In the following example, the client URLs have the form
https://portal.example.com/host42/...
and the server URLs have the form
http://host42.example.com/...
This example uses client URLs beginning with "https", which means you have to configure service port 443 as an HTTPS port. This configuration is outside the scope of this KB article.
Here is a policy that implements the example:
define url_rewrite P
rewrite_url_prefix "https://portal.example.com/host42/" "http://host42.example.com/"
end
define action portal
rewrite(url, "https://portal.example.com/host42/(.*)", "http://host42.example.com/$(1)")
transform P
end
define action force_uncompressed
delete( request.header.Accept-Encoding )
end
<Proxy>
url=https://portal.example.com/ action.portal(yes)
<Cache>
action.force_uncompressed(yes)
Here's how this policy works: