I found out that knox didn't rewrite /static/jquery-1.10.2.min.js in HDFS
home page(url: https://knox_host:port/gateway/test/hdfs/dfshealth.html),
which was causing some UI issues.
After some digging, I found out the following two rules, which can both
match the string (/static/jquery-1.10.2.min.js)
If I remove rule2, the rewrite will start to work.
Is this a bug? Shouldn't knox only apply rules for the same service(in my
case hdfsui)?
*rule1:*
<rule dir="OUT" name="HDFSUI/content/static" pattern="/static/{**}">
<rewrite template="{gateway.url}/hdfs/static/{**}"/>
</rule>
*source:*
https://github.com/apache/knox/blob/master/gateway-service-definitions/src/main/resources/services/hdfsui/2.7.0/rewrite.xml#L67
*rule2:*
<rule dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/static/jquery"
pattern="/static/{jquery=jquery*.min.js}">
<rewrite template="{$frontend[url]}/sparkhistory/static/{jquery}"/>
</rule>
*source:*
https://github.com/apache/knox/blob/master/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/rewrite.xml#L56