Hi Larry - Thanks again for your reply. I dug more on this issue and I think I've found the root cause. Please take a look at https://issues.apache.org/jira/browse/KNOX-1157 when you get a chance.
Thanks. On Wed, Dec 27, 2017 at 4:02 PM, larry mccay <[email protected]> wrote: > Hi Wei - > > Sorry for not responding. > > Rewrite rules are global for REST APIs and local for anything else. > So, for the UIs they should be resolving as local. > > Only REST APIs that require the rewrite rules from other services need > global resolution. > Things like Oozie. > > Do I owe you any other answer here? > > thanks, > > --larry > > On Wed, Dec 27, 2017 at 2:23 PM, Wei Han <[email protected]> wrote: > >> Hi Larry - I haven't heard from you about this yet. Could you take a look >> when you get a chance? >> >> On Wed, Dec 13, 2017 at 3:41 PM, Wei Han <[email protected]> wrote: >> >>> Hi Larry - Thanks for your response. Actually hdfsui and sparkhistoryui >>> are two different services. My understanding is a rewrite rule change in >>> sparkhistoryui shouldn't affect hdfsui, is this the right assumption? Are >>> these outbound rules designed to be global, or local to the service? >>> >>> Thanks. >>> >>> On Wed, Dec 13, 2017 at 12:12 PM, larry mccay <[email protected]> wrote: >>> >>>> Hi Wei - >>>> >>>> Thank you for tracking that down! >>>> >>>> Yes, I believe it is a bug but may be slightly more than that >>>> considering the same service def is being used for multiple logical UIs. >>>> Those being HDFSUI and SPARKHISTORYUI - these likely need to be broken >>>> out separately to avoid such things. >>>> >>>> I suspect that sparkhistoryui isn't going to work now that you removed >>>> that second rule. >>>> >>>> Can you please file a JIRA for this and if you provide a patch, we can >>>> review and possibly commit it as is - as long as sparkhistory ui still >>>> works. >>>> >>>> thanks again! >>>> >>>> --larry >>>> >>>> On Wed, Dec 13, 2017 at 2:55 PM, Wei Han <[email protected]> wrote: >>>> >>>>> 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-d >>>>> efinitions/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]}/spa >>>>> rkhistory/static/{jquery}"/> >>>>> >>>>> </rule> >>>>> >>>>> >>>>> *source:* >>>>> >>>>> https://github.com/apache/knox/blob/master/gateway-service-d >>>>> efinitions/src/main/resources/services/sparkhistoryui/1.4.0/ >>>>> rewrite.xml#L56 >>>>> >>>>> >>>>> >>>>> >>>> >>> >> >
