Nginx を使用して、4 つの個別のサイトで構成される 1 つのサーバー用に複数ドメインのセットアップを作成しました。Nginx を起動すると、エラー メッセージが表示され、1 つの URL を入力すると他のサイトの 1 つにつながるため、サイトが混同されているように見えます。
表示されるエラーメッセージ -
Restarting nginx: nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx.
/sites-available の下のそれぞれのファイルで、4 つのドメインすべてを同様の方法でセットアップしました。
server {
listen 80;
root /var/www/example.com/public_html;
index index.php index.html index.htm;
server_name example.com www.example.com;
location / {
try_files $uri $uri/ /index.html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
確認したところ、/sites-enabled に既定のファイルはありません。Nginxのメイン構成に誤った設定がある可能性があると推測していますが、何を探すべきかはわかりません.