Hi Sandeep, Thanks for looking into it.
Yes, I tried that before, the value can be replaced correctly, but the webpage is just stuck there, no redirect happens. The result in html is <meta http-equiv="refresh" content="https://host:port/something">, which however, should be <meta http-equiv="refresh" content="*1; url=* https://host:port/something">. It seems the html meta refresh format requires *'1; url='*, where the 1 means stop for 1 seconds before refresh. Thanks, Guang On Fri, Mar 2, 2018 at 6:49 AM, Sandeep Moré <[email protected]> wrote: > Hello Guang, > > This does look like a bug, after some digging it appears it was as a > result of KNOX-973. > > Have you tried using > > <rewrite template="{$frontend[url]}/jobstoryui/jobstory/ > jobhistory/logs/{**}"/> > > I am curious to see what you get. > > > Best, > Sandeep > > > > > On Thu, Mar 1, 2018 at 4:30 PM, Guang Yang <[email protected]> wrote: > >> Hi, >> >> I'm currently working on the Map Reduce Job History UI rewrite rules, and >> found several potential bugs here. >> >> <rewrite template="1; url=/gateway/jobstoryui/jobsto >> ry/jobhistory/logs/{**}"/> >> For this rewrite template >> <https://github.com/apache/knox/blob/master/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml#L104>, >> let's not say what the `jobstory` is here for now. I think the target >> url should start with something like {$frontend[url]}, just like other OUT >> rules, because the previous one doesn't specify the deployment/environment >> after word `gateway`. >> >> But after I change it to <rewrite template="1; url={$frontend[url]}/ >> jobstoryui/jobstory/jobhistory/logs/{**}"/>, the variable >> {$frontend[url]} is not replaced with the right value, it's just literal >> `{$frontend[url]}` in the target url. And I found that only when the >> variable following the double quotes, it can be replaced, otherwise it just >> stays there as literal text. >> >> My question is, anyone knows how to fix this bug? Or how to get >> {$frontend[url]} >> replaced with right value even it's not at the beginning of the template? >> >> Btw, I think the right template should be <rewrite template="1; >> url={$frontend[url]}/jobhistory/joblogs/{**}"/>. >> >> Appreciate for any help. >> >> Thanks, >> Guang >> >> >> >
