How to have Jetty redirect http to https

Posted by Noel Kennedy on Server Fault See other posts from Server Fault or by Noel Kennedy
Published on 2012-03-08T14:37:58Z Indexed on 2012/09/12 21:40 UTC
Read the original article Hit count: 250

Filed under:

I want to redirect all requests for http to https using Jetty (6.1.24). For some reason (my ignorance) this is eluding me. This is what I have:

<New id="redirect" class="org.mortbay.jetty.handler.rewrite.RedirectPatternRule">
  <Set name="pattern">http://foobar.com/*</Set>
  <Set name="location">https://foobar.com</Set>
</New>

In response I get 200 - ok, and the body is the page over http, ie the redirect doesn't occur.

© Server Fault or respective owner

Related posts about jetty