我想使用 Jetty (6.1.24) 将所有对 http 的请求重定向到 https。出于某种原因(我的无知)这让我望而却步。这就是我所拥有的:
<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>
Run Code Online (Sandbox Code Playgroud)
作为回应,我得到 200 - 好的,正文是 http 上的页面,即不会发生重定向。
jetty ×1