gpt4 book ai didi

redirect - Nginx 将 https www 重定向到 https 非 www

转载 作者:太空宇宙 更新时间:2023-11-03 14:59:11 24 4
gpt4 key购买 nike

我的域 mydomain.com 有 SSL 证书(没有 www.)Nginx 配置:

server
{
server_name www.mydomain.com;
return 301 $scheme://mydomain.com$request_uri;
}

除了 https://www.mydomain.com -> https://mydomain.com 之外,所有重定向都工作正常。每个浏览器都会向我显示一条警告消息,如下所示:

    This Connection is Untrusted

You have asked Firefox to connect securely to www.mydomain.com,
but we can't confirm that your connection is secure.

我该怎么办?

最佳答案

不,这是不可能的。 HTTPS 是 SSL 内部的 HTTP,因此要首先获得 HTTP 重定向,必须建立和验证 SSL 连接 - 如果您不使用浏览器不信任的证书(例如自签名或其中主机名与证书不匹配)。

关于redirect - Nginx 将 https www 重定向到 https 非 www,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25058021/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com