【问题标题】:Running Moqui on Tomcat over SSL (setting http-port and htts-port) - return code 302通过 SSL 在 Tomcat 上运行 Moqui(设置 http-port 和 htts-port) - 返回码 302
【发布时间】:2016-11-05 22:17:49
【问题描述】:

我有一个配置了 SSL 的 Tomcat 服务器。我可以访问 Tomcat Web 应用程序管理器,连接是安全的。 Tomcat 服务器可以通过 80 和 443 端口访问,并且是 dockerized(容器的端口是 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 文件,里面有什么需要修改的吗?

【问题讨论】:

    标签: ssl tomcat8 moqui


    【解决方案1】:

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

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

    希望对某人有所帮助。

    【讨论】:

    • 你是不是真的有“”,或者类似“demo.moqui.org”的东西(即一个有效的主机名)?我猜这就是你的意思,但想验证一下。要看的是 moqui 正在生成什么样的屏幕 URL,并确保它们是可访问的……有时当通过代理或任何 Servlet 容器(在本例中为 Tomcat)时,没有得到正确的外部主机名,因此需要这些配置设置。
    • 目前,我还没有遇到任何有关配置的问题,因为所有这些都是在一台服务器上完成的,没有任何特殊性。是的,我在“serverx.mydomain.sk”样式中添加了地址(或名称)。 应该是一个提示。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-14
    • 1970-01-01
    • 2014-03-26
    • 2020-07-15
    • 2015-09-23
    • 2023-03-24
    相关资源
    最近更新 更多