Redirect HTTP to HTTPS:PORT in Tomcat

后端 未结 6 840
傲寒
傲寒 2020-12-08 20:33

I have a running tomcat application that already have the following redirection rule from HTTP to HTTPs:



        
6条回答
  •  悲&欢浪女
    2020-12-08 21:27

    I have a running tomcat application that already have the following redirection rule from HTTP to HTTPs:

    As malaguna answered, that Connector configuration is not a redirection rule. It is just a setting that is used when performing redirection triggered by CONFIDENTIAL.

    There is no way to overwrite that setting on per-application basis.

    If you need better control over such redirection, you need to implement your own Filter that will implement a redirection (if (!request.isSecure()) { response.sendRedirect(...);}), or configure a 3rd party one.

    // Technically, in current Tomcat 8 code the redirection triggered by transport-guarantee is performed by org.apache.catalina.realm.RealmBase.hasUserDataPermission(...) method.

提交回复
热议问题