【问题标题】:How to activate 2 ports 80 & 4000 for a single SSL enabled domain?如何为单个启用 SSL 的域激活 2 个端口 80 和 4000?
【发布时间】:2017-09-14 17:51:25
【问题描述】:

我是 SSL 加密新手,需要帮助! (使用证书机器人)。

我最近在一个在 apache 和 linux 的 80 端口上运行的网站上激活了 SSL。所以,当前网站看起来像:

http://example.com --> https://example.com (done)

但是,我在端口 4000 上运行了后端,并希望对其进行加密以避免“混合内容”页面错误:

http://example.com:4000 --> https://example.com:4000 (Not done yet)

这正是我所需要的,没有任何解决方法会有所帮助。请指导。

提前致谢! :-)

【问题讨论】:

  • 嘿 Vaibhav,您可以将子域 subdomain.example.com 重定向到 example.com:4000 并从 LetsEncrypt 请求新证书,并在请求证书时指定多个子域。 certbot certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net查看certbot官方文档here

标签: linux apache ssl https mixed-content


【解决方案1】:

您可以创建一个新的子域subdomain.example.com 并将其指向example.com:4000,然后从 LetsEncrypt 请求新的 SSL 证书,并在使用 certbot 请求证书时指定多个子域。

certbot certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net

当您拥有证书和密钥后,将其添加到您的网络服务器配置中

查看官方 certbot 文档here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-30
    • 2020-01-26
    • 2011-03-04
    • 2021-07-23
    • 2014-06-13
    • 2016-09-17
    • 2015-01-17
    • 2018-11-08
    相关资源
    最近更新 更多