Header RSS Feed
If you only want to see the articles of a certain category, please click on the desired category below:
ALL Android Backup BSD Database Hacks Hardware Internet Linux Mail MySQL Monitoring Network Personal PHP Proxy Shell Solaris Unix Virtualization VMware Windows Wyse

Nginx emerg error: could not build the server_names_hash
Thursday - Jun 5th 2014 - by - (0 comments)

I saw a weird error today where nginx wouldn't start after setting up the vhost configuration:

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

The reason for this was a very long server_name in the vhost config:

 server_name confluence.myfirsttestpage123.examplewebsite.com ;

The defined server_name was so long, that the hash, generated by the sever_name string, was longer than 64. The current setup had a fixed limit of a hash bucket size of 64:

grep server_names_hash_bucket_size /etc/nginx/nginx.conf
  server_names_hash_bucket_size 64;

By increasing the value to 128, the config was correctly loaded and nginx started up.

grep server_names_hash_bucket_size /etc/nginx/nginx.conf
  server_names_hash_bucket_size 128;

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Another solution would be to use a shorter server_name, of course.
That would make more sense, agreed. But leave it to the customer to come up with such great server names...


Add a comment

Show form to leave a comment

Comments (newest first):

No comments yet.

Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

6938 Days
until Death of Computers