[Nginx] nginx: [emerg] could not build the server_names_hash…

Nginx でどんどこバーチャルホストを追加していると、以下の様なエラーが表示されて設定ファイルの再読み込みができなくなることがあります。

nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 64

まぁ、言ってるとおりですね。
server_names_hash_bucket が足りなくなってるので増やせよっつってるので、/etc/nginx/nginx.conf に以下を追加しましょう。
網元使ってる場合は /etc/nginx/nginx.conf が再起動時に元に戻ってしまうので /etc/nginx/conf.d/00_server_name_hash_settings.conf という名前で、以下の内容のファイルを作ってやってください。


server_names_hash_bucket_size 128;
server_names_hash_max_size 1024;


Posted

in

by

Tags:

Comments

コメントを残す