Hi All,
I am trying to configure an Ambari Service I wrote to work with Knox. I am in
the process of testing the server.xml and rewrite.xml files I wrote and am
having some issues with 302 responses that my Web Server is responding with.
When accessing the context root of the web application the web server is
redirecting me to the landing page which is a jsp page that serves up an
angular-js application. But with the following configuration I end up with a
redirect loop. If I don’t have the redirect rewrite then I break out of the
proxy address and get pointed to the internal address of the service (which I
obv. don’t want).
Here is my current configuration:
<rules>
<rule dir="IN" name=“FOO/foo/inbound" pattern="*://*:*/**/foo/{**}">
<rewrite template="{$serviceUrl[FOO]}/{**}"/>
</rule>
<rule dir="OUT" name=“FOO/foo/location/outbound">
<match pattern="*://*:*/{**}"/>
<rewrite template="{gateway.url}/foo/{**}"/>
</rule>
<filter name=“FOO/foo/headers/outbound">
<content type="application/x-http-headers">
<apply path="Location" rule=“FOO/foo/location/outbound"/>
</content>
</filter>
</rules>
<service role=“FOO" name=“foo" version=“1.0.0">
<routes>
<route path=“/foo/**?**">
<rewrite apply=“FOO/foo/headers/outbound"
to="response.headers"/>
</route>
</routes>
</service>
Here is what I would like to happen:
GET: https://gateway-host:8443/gateway/default/foo/contextroot
<Authenticate via BASIC Auth, succeeds>
302:Location: https;//gateway-host:8443/gateway/default/foo/contextroot/
Resulting in login screen at:
https://gateway-host:8443/gateway/default/foo/contextroot/#/login
What am i doing wrong? Any comments/suggestion would be grateful.
Regards,
Christopher Jackson