<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Rewrite of Absolute URL in Knox? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95157#M8493</link>
    <description>&lt;P&gt;Unfortunately that isn't going to work, at least not the way you are thinking about it.  There are a few reasons for this.  The first is that each topology file is deployed within the server "under the covers" as a JEE WAR.  In particular it is deployed on a context path made up of the value of gateway.path in gateway-site.xml and the name of the topology file.  So all of the URLs will start with {gateway.path}/{topology} no matter what.  Beyond that each service or app generally then carves out a unique subcontext to avoid collisions.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Oct 2015 22:34:53 GMT</pubDate>
    <dc:creator>kevin_minder</dc:creator>
    <dc:date>2015-10-09T22:34:53Z</dc:date>
    <item>
      <title>Rewrite of Absolute URL in Knox?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95154#M8490</link>
      <description>&lt;P&gt;I am trying to define a rewrite pattern in Knox that would rewrite a URL like &lt;A href="https://sandbox:8443/myLogo.png" target="_blank"&gt;https://sandbox:8443/myLogo.png&lt;/A&gt; to &lt;A href="https://sandbox:8443/gateway/default/myservice/myLogo.png" target="_blank"&gt;https://sandbox:8443/gateway/default/myservice/myLogo.png&lt;/A&gt;. Is that even possible? An example would be helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 18:13:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95154#M8490</guid>
      <dc:creator>hkropp</dc:creator>
      <dc:date>2015-10-09T18:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rewrite of Absolute URL in Knox?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95155#M8491</link>
      <description>&lt;P&gt;Look for example at this HBase rule which does something similar to what I believe you are asking.  This rule however will handle anything under **/hbase due to the ** in {path=**}.&lt;/P&gt;&lt;PRE&gt;&amp;lt;rule dir="IN" name="WEBHBASE/webhbase/path/inbound" pattern="*://*:*/**/hbase/{path=**}?{**}"&amp;gt;
    &amp;lt;rewrite template="{$serviceUrl[WEBHBASE]}/{path=**}?{**}"/&amp;gt;
&amp;lt;/rule&amp;gt;&lt;/PRE&gt;&lt;P&gt;You can certainly also write a pattern for a single file.  I assume here that your service's role is MYSERVICE which is why it is upper case in the $serviceUrl[MYSERVICE] function.  That could hypothetically look something like this:&lt;/P&gt;&lt;PRE&gt;&amp;lt;rule dir="IN" name="MYSERVICE/myservice/logo" pattern="*://*:*/**/myservice/myLogo.png?{**}"&amp;gt;
    &amp;lt;rewrite template="{$serviceUrl[MYSERVICE]}/myLogo.png?{**}"/&amp;gt;
&amp;lt;/rule&amp;gt;&lt;/PRE&gt;&lt;P&gt;I wasn't sure about including the ?{**} in the rewrite template to propagate the query parameters but it is a good idea to include it in the match pattern to make it as general as possible.  If you didn't include the ?{**} in the rewrite template the query parameters would not be copied over from the original matched URL.  Either behavior may be what you want. &lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 20:46:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95155#M8491</guid>
      <dc:creator>kevin_minder</dc:creator>
      <dc:date>2015-10-09T20:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rewrite of Absolute URL in Knox?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95156#M8492</link>
      <description>&lt;P&gt;Did not work for me. The special point is that I need the following pattern to be accepted "*://*:*/logo.png" I don't want it under **/myservice&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 21:22:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95156#M8492</guid>
      <dc:creator>hkropp</dc:creator>
      <dc:date>2015-10-09T21:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rewrite of Absolute URL in Knox?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95157#M8493</link>
      <description>&lt;P&gt;Unfortunately that isn't going to work, at least not the way you are thinking about it.  There are a few reasons for this.  The first is that each topology file is deployed within the server "under the covers" as a JEE WAR.  In particular it is deployed on a context path made up of the value of gateway.path in gateway-site.xml and the name of the topology file.  So all of the URLs will start with {gateway.path}/{topology} no matter what.  Beyond that each service or app generally then carves out a unique subcontext to avoid collisions.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 22:34:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95157#M8493</guid>
      <dc:creator>kevin_minder</dc:creator>
      <dc:date>2015-10-09T22:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rewrite of Absolute URL in Knox?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95158#M8494</link>
      <description>&lt;P&gt;However, the way you need to be thinking about this is to rewrite the URL in the outbound response in which it is contained.  This is certainly more complex but you can find some examples of how to do this in the HBase integration in data/services/hbase/0.98.0.  It involves the use of filters on the outbound response bodies.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 22:40:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Rewrite-of-Absolute-URL-in-Knox/m-p/95158#M8494</guid>
      <dc:creator>kevin_minder</dc:creator>
      <dc:date>2015-10-09T22:40:07Z</dc:date>
    </item>
  </channel>
</rss>

