<?xml version="1.0"?>
<metaproxy xmlns="http://indexdata.com/metaproxy" version="1.0">
  <start route="start"/>
  <routes>
    <route id="start">
      <filter type="http_rewrite">
        <request verbose="1">
          <rule name="null"/>
          <rule name="url">
            <rewrite from="(?&lt;proto&gt;https?://)(?&lt;pxhost&gt;[^ /?#]+)/(?&lt;pxpath&gt;[^ /]+)/(?&lt;host&gt;[^ /]+)(?&lt;path&gt;[^ ]*)" to="${proto}${host}${path}"/>
            <rewrite from="(?:Host: )(.*)" to="Host: ${host}"/>
          </rule>
          <content type="headers">
            <within header="link" rule="null"/>
            <within reqline="1" rule="url"/>
          </content>
        </request>
        <response verbose="1">
          <rule name="null"/>
          <rule name="url">
            <rewrite from="foo" to="bar"/>
            <rewrite from="^cx" to="cy"/>
            <rewrite from="(?&lt;proto&gt;https?://)(?&lt;host&gt;[^/?# &quot;'&gt;]+)/(?&lt;path&gt;[^  &quot;'&gt;]+)" to="${proto}${pxhost}/${pxpath}/${host}/${path}"/>
          </rule>
          <content type="headers">
            <within header="link" rule="url"/>
          </content>
          <content mime="text/xml|text/html" type="html">
            <within attr="background" rule="null" tag="body"/>
            <within attr="#text" rule="url" tag="script" type="quoted-literal"/>
            <within attr="#text" rule="url" tag="style"/>
            <within attr="href,src" rule="url"/>
            <within attr="onclick" rule="url" type="quoted-literal"/>
          </content>
          <content mime=".*javascript" type="quoted-literal">
            <within rule="url"/>
          </content>
        </response>
      </filter>
    </route>
  </routes>
</metaproxy>
