如何在resin4.0中将https://请求重定向到http://中

如何在resin4.0中将https://请求重定向到http://中,http,https,openssl,web.xml,resin,Http,Https,Openssl,Web.xml,Resin,事实上,当我在web.xml中添加一个过滤器时,我得到了将http重定向到https的方法。 比如, SSL /xxx/* 保密的 在这种情况下,我可以在https模式下请求像/xxx/*这样的URL。 还有一些其他URL,如/yyy/*,必须在http模式下请求,因此如何才能做到这一点?在resin-web.xml中,您可以使用resin-rewrite标记重定向到其他URL,并检查IfSecure等条件 例如,您的WEB-INF/resin-WEB.xml可能如下所示 <web-a

事实上,当我在web.xml中添加一个过滤器时,我得到了将http重定向到https的方法。 比如,


SSL
/xxx/*
保密的
在这种情况下,我可以在https模式下请求像
/xxx/*
这样的URL。
还有一些其他URL,如
/yyy/*
,必须在http模式下请求,因此如何才能做到这一点?

在resin-web.xml中,您可以使用resin-rewrite标记重定向到其他URL,并检查IfSecure等条件

例如,您的WEB-INF/resin-WEB.xml可能如下所示

<web-app xmlns="http://caucho.com/ns/resin"
         xmlns:resin="urn:java:com.caucho.resin">

  <resin:Redirect regexp="^/xxx/" target="https://myhost.com/xxx/">
    <resin:IfSecure value="false"/>
  </resin:Redirect>

  <resin:Redirect regexp="^/yyy/" target="http://myhost.com/yyy/">
    <resin:IfSecure value="true"/>
  </resin:Redirect>

</web-app>

第一个匹配您的/xxx,并检查它是否为SSL连接。如果不是SSL连接,它将重定向到主机的https。否则,该规则将被忽略


第二个匹配您的/yyy,并检查它是否为SSL连接。如果是SSL连接,它将重定向到主机的http。否则该规则将被忽略。

在resin-web.xml中,您可以使用resin-rewrite标记重定向到其他URL,并检查IfSecure之类的条件

例如,您的WEB-INF/resin-WEB.xml可能如下所示

<web-app xmlns="http://caucho.com/ns/resin"
         xmlns:resin="urn:java:com.caucho.resin">

  <resin:Redirect regexp="^/xxx/" target="https://myhost.com/xxx/">
    <resin:IfSecure value="false"/>
  </resin:Redirect>

  <resin:Redirect regexp="^/yyy/" target="http://myhost.com/yyy/">
    <resin:IfSecure value="true"/>
  </resin:Redirect>

</web-app>

第一个匹配您的/xxx,并检查它是否为SSL连接。如果不是SSL连接,它将重定向到主机的https。否则,该规则将被忽略

第二个匹配您的/yyy,并检查它是否为SSL连接。如果是SSL连接,它将重定向到主机的http。否则,该规则将被忽略