Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Jetty 9中从http永久重定向到https_Http_Redirect_Https_Jetty - Fatal编程技术网

在Jetty 9中从http永久重定向到https

在Jetty 9中从http永久重定向到https,http,redirect,https,jetty,Http,Redirect,Https,Jetty,您好,我正在尝试在jetty 9中设置从http到https的永久重定向301。我到处都能找到的解决方案是在我的web.xml中添加以下内容 <security-constraint> <web-resource-collection> <web-resource-name>Everything</web-resource-name> <url-pattern>/*</url-pattern> &

您好,我正在尝试在jetty 9中设置从http到https的永久重定向301。我到处都能找到的解决方案是在我的web.xml中添加以下内容

    <security-constraint>
  <web-resource-collection>
   <web-resource-name>Everything</web-resource-name>
   <url-pattern>/*</url-pattern>
  </web-resource-collection>
  <user-data-constraint>
   <transport-guarantee>INTEGRAL</transport-guarantee>
  </user-data-constraint>
</security-constraint>

这设置了302重定向而不是301重定向,这是一个大问题,有人知道我如何将其更改为301重定向吗?

我认为您在传输保证中犯了错误,因此您必须将其改为

在WEB-INF/WEB.xml中

每件事 /* 保密的 在Jetty XML中

... 443
我没有犯错误。我在运输保证中尝试了“机密”和“集成”,据我所知,两者都导致了完全相同的行为。您是否添加了连接器?如果你不检查我的答案编辑。