I'm trying to deploy a jetty servlet using ARR and urlrewrite to create a reverse proxy. If I enable "Reverse rewrite host in response headers" then everything seems to work fine. I access the servlet at www.example.com/servlet, the address stays the same in the browser but the servlet is accessed at localhost:8080.
The issue is that this servlet returns 302 redirects depending on get parameters. So for example if I go to www.example.com/servlet?input=cleaning then I will get a 302 redirect which might go to www.cleaningexample.com/howtoclean. The reverse rewrite host rule means that instead of seeing this url the client is returned www.example.com/howtoclean.
I can't set a static outbound rule as I don't know ahead of time which address the 302 redirect may return.
If I disable the reverse rewrite host then the url in the browser changes from www.example.com/servlet to localhost:8080/servlet.
I've tried replacing the host in an outbound rule but I can't find anywhere to get the original location header returned by the servlet to replace the rewritten Location host with.
Is there a way to get this working correctly?