0
サービスプロバイダに登録されており、nginxでlinodeでホスティングしている複数のドメインがあります。マルチドメイン環境でnon wwwをnginxにリダイレクトする方法
ドメイン名の例がwww.example.comである(ないexample.com)
すべてのドメインは、WWWで正常に動作しているが、それなしでページがロードされません。
In curl -I http://example.com
それは私が私の/etc/nginx/sites-available
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
access_log /var/log/nginx/example.com.log;
error_log /var/log/nginx/example.com-error error;
root /var/www/examplecom/public;
index index.html index.php;
location ~ \.php?$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/var/run/php-main.socket;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(.+\.php)(.*)$;
#Prevent version info leakage
fastcgi_hide_header X-Powered-By;
}
}
server {
listen 80;
server_name example.com;
return 301 $scheme://www.example.com$request_uri;
}
私も書き込むことで試してみましたが、各個別
blank IP
mail IP
www IP
ための3 A/AAAAレコードを持っている
curl: (6) Could not resolve host http://example.com
結果第2サーバb一番上にあるが同じ結果にロックする。
すぐに指針/ヘルプが必要です。
'host'解決できませんでした - 適切 –
DNSができ、あなたのDNSを設定する必要があります意味伝播に時間がかかる。あなたのAレコードが「空白」と書かれていると仮定すると、実際には空白になります(ルートレベルの「example.com」ではなく「blank.example.com」ではない)。 –