我有一台配置了SSL的Tomcat服务器。我可以访问Tomcat Web应用程序管理器,连接是安全的。 Tomcat服务器可在端口80和443上访问,并且已被docker化(容器的端口为8080和8443)。

该应用程序在http上运行良好,未发现任何问题。

然后,我决定切换到https。因此,我以这种方式修改了MoquiProductionConf.xml网络应用标签:

<webapp-list>
    <!-- NOTE: when you set https-enabled="true" make sure to set the http-port and https-port attributes -->
    <webapp name="webroot" http-port="80" http-host=""
            https-port="443" https-host="" https-enabled="true"
            require-session-token="true">
        <root-screen host=".*" location="component://webroot/screen/webroot.xml"/>
    </webapp>
</webapp-list>


无法通过http://或https://访问该应用程序。我尚未更改http-host / https-host。返回代码是302(根据tomcat的localhost_access_log)。

我也必须填写主持人吗?
我是否需要更改配置中的其他内容?我在框架的WEB-INF文件夹中找到了web.xml文件,其中需要修改。

最佳答案

对于那些寻找答案的人-这个对我有用。

<webapp-list>
    <!-- NOTE: when you set https-enabled="true" make sure to set the http-port and https-port attributes -->
    <webapp name="webroot" http-port="80" http-host="<server_address>"
            https-port="443" https-host="<server_address>" https-enabled="true"
            require-session-token="true">
        <root-screen host=".*" location="component://webroot/screen/webroot.xml"/>
    </webapp>
</webapp-list>


希望它可以帮助某人。

10-07 19:02
查看更多