通过SSL在Tomcat上运行Moqui(设置http-port和htts-port) - 返回代码302

时间:2016-07-04 08:47:39

标签: ssl tomcat8 moqui

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

该应用程序在http上工作正常,没有发现任何问题。

然后我决定切换到https。所以我用这种方式修改了MoquiProductionConf.xml web-app标签:

<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文件,其中有些东西需要修改。

1 个答案:

答案 0 :(得分:0)

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

<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>

希望它有所帮助。