Examples of Content Policy Language rewrite() action when Dealing with IPv4 hosts

book

Article ID: 170708

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

SGOS policy administrator is interested in using the Content Policy Language's rewrite() action to rewrite host in IPv4 format for the and layers.

Resolution

The following examples illustrates how hosts in IPv4 formats can be rewritten using CPL's rewrite() action in the <proxy> and <ssl-intercept> layers:
define action HTTP_rewrite
    rewrite(url, "^http://192\.168\.1\.2/(.*)", "http://192.168.1.1/$(1)")
end
<proxy>
url.domain=//192.168.1.2/ action.HTTP_rewrite(yes)

define action HTTPS_rewrite
    rewrite( url.host, "(.*)192\.168\.1\.2(.*)", "$(1)192.168.1.1$(2)" )
end
<ssl-intercept>
url.domain=//192.168.1.2/ action.HTTPS_rewrite(yes)