【发布时间】:2016-10-13 04:09:15
【问题描述】:
我有几个重定向,以确保所有域和变体都指向当前的主要位置:
#redirects www
server {
server_name www.blah.net;
return 301 https://blah.org$request_uri;
}
server {
server_name www.blah.co;
return 301 https://blah.org$request_uri;
}
#redirects co and net to org
server {
server_name blah.co;
return 301 https://blah.org$request_uri;
}
server {
server_name blah.net;
return 301 https://blah.org$request_uri;
}
#redirects all traffic to https
server {
listen *:80 default_server;
location / {
return 301 https://$host$request_uri;
}
}
#main server
server {
listen *:443 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/www.blah.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.blah.org/privkey.pem;
root /home/blah/www;
index index.html index.htm;
server_name blah.org blah.co blah.net;
}
问题是我们的顶级谷歌搜索结果有一个指向https://blah.co 的链接,当您单击它时,它会给出证书错误。我知道问题出在哪里,我只是不知道如何修复重定向,以便当有人点击包含https 的链接或输入https://blah.co 时,它会解析为https://blah.org。
【问题讨论】:
-
获取
blah.co的有效证书 -
@AlexeyTen 关键是要避免这种情况 - 并将所有流量重定向到 blah.org 这是唯一具有有效证书的站点。
-
https 的意义在于让这种情况无法避免
标签: ssl nginx ssl-certificate