Nginx: could not build the server_names_hash, you should increase server_names_hash_bucket_size

could not build the server_names_hash, you should increase server_names_hash_bucket_size

I got this error when I added a new host in the Nginx configuration file, but don’t worry, it’s very easy to fix it.

Just add the next line in the http block:

http {

  server_names_hash_bucket_size 64;

}

Now, restart Nginx and it should works.

service restart nginx

Read more about server_names_hash_bucket_size