各位大大好:
小弟目前nginx的環境中,有10個vhost,均正常運作中。
但,其中的一個網域,使用Let’s Encrypt SSL,也可正常使用443連入網站裡面,例如網址:https://www.E.com.tw運作也正常(vhost中,唯一使用https的網址)。
隔了幾天之後,在google用關鍵字搜尋,卻發現到,以http為主的其它網站,卻在google的搜尋頁面中出現,例如搜尋『汽車』的結果,卻出現
https://www.a.com.tw、https://www.b.com.tw、https://www.c.com.tw 等等的網址(非https的設定網址),卻出現在google的搜尋頁面當中,標題和搜尋內容是E網站的正確資訊,而網址卻是a、b、c...等等。
也訧是google搜尋的結果,是https://www.E.com.tw,這個網站的正確內容,而google頁面中的連結網址卻是連進其它a、b、c...的網站,而不是進入https://www.E.com.tw,而出現『你的連線不是私人連線』,因為網址連錯了跑到https://www.a.com.tw這個網域中。
我的
https://www.E.com.tw 設定如下:
server {
listen 443 default_server ssl;
server_name
www.E.com.tw E.com.tw;
error_page 404 403 500 502 503 504 /ER404.php;
location / {
root /var/www/Edir;
index index.html index.php;
}
location ~ \.php$ {
root /var/www/Edir;
fastcgi_pass 127.0.0.1:9071;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
.
.
.
.
.
}
server {
listen 80;
server_name
www.E.com.tw E.com.tw;
return 301
https://www.E.com.tw$request_uri;
}
而其它的http設定如下:
server {
listen 80;
server_name
www.a.com.tw a.com.tw;
error_page 404 403 500 502 503 504 /ER404.php;
location / {
root /var/www/Adir;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /var/www/Adir;
fastcgi_pass 127.0.0.1:9071;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /.well-known { allow all; }
location ~ /\. { deny all; }
}
煩請各位大大不吝指導,感恩。