在 https 上的生产服务器 运行 中,但在实时(在 Internet 上)中它仅显示 http

In production server running on https but in Live(On Internet) it's shows http only

我正在使用 Tomcat 7.0+ 开发 Liferay。 我的 Web 应用程序与 www.hpmc.in.

一起运行

我已经成功安装了 SSL 证书,并且我还在 tomcat/conf/ 文件夹中的 server.xml 和 web.xml 中进行了相关更改。

在生产服务器请求重定向到 https://localhost:8080/____ but in live it's shows only http://hpmc.in/

请帮帮我。

Server.xml

<Connector port="8080" protocol="org.apache.coyote.http11.Http11Protocol"
           maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
           keystoreFile="XXX/XXX/XXXX.jks" keystorePass="XXXX"
           clientAuth="false" sslProtocol="TLS" />

在 web.xml 我添加了以下行。

    <security-constraint>
<web-resource-collection>
<web-resource-name>HPMC Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

Production Server URL Image

首先,

Why are you using port 8080 for https traffic?

此 (8080) 端口和 80 旨在用于 non-secured 数据(8080 用于 内部 80 用于 外部 )。您应该将 443/8443 用于 https 流量,这是 Tomcat 安全 (SSL/TLS) 数据的标准。

您还想测试以下属性:

web.server.protocol=https

https://docs.liferay.com/ce/portal/7.0-latest/propertiesdoc/portal.properties.html

根据您的评论,我不确定它是否在代理后面,如果是,您可能需要检查一下:https://www.e-systems.tech/docker-images/-/knowledge_base/docker-images/liferay-behind-a-reverse-proxy

我猜你这样做是因为我无法连接到你在 8080 上提供的地址,只有 80。所以这要么是代理,要么是你提供的配置中缺少配置,要么是奇怪的配置。由于 8080 通向 ERR_CONNECTION_TIMED_OUT,我认为您没有打开此连接器,或者它被阻止了。

需要更多信息才能帮助您。