Cent OS 6.1 を使用しています。ソースから ./configure メソッドで Nginx をインストールしました。nginx サーバーを起動して、sudo nginx
Nginx へようこそページを提供できます。
しかし、/usr/local/nginx/conf/nginx.conf ファイルを編集すると、...location / {... }...
ブロックを変更しても効果がないことがわかりました。
たとえば、
location / {
root html;
index index.htm index.html;
}
に
location / {
root xyz123; #which does not exist
index index.htm index.html;
}
404 を返す必要があります。しかし、ウェルカム ページが表示され続けます。
ロケーション ブロック全体を削除しても、まだウェルカム ページが表示されます。しかし、変更する/usr/local/nginx/html
と/usr/local/nginx/htmlxyz
404 が表示されます。nginx.conf を上書きした別の conf ファイルが実行されていますか?
ps私はその時やったsudo nginx -s stop
が助けにはsudo nginx
ならなかった:(sudo nginx -s reopen