Skip to content
MtrXTools

could not build server_names_hash, you should increase server_names_hash_bucket_size

A server_name is too long for the hash table

Seen in nginx start-up and nginx -t ([emerg])

nginx couldn't fit a long server_name into its hash bucket size and refused to load the configuration.

Common causes

  • A long hostname in server_name (common with long subdomains or cloud hostnames).
  • Many server names with the default bucket size of 32 or 64 bytes.

How to fix it

  1. Add server_names_hash_bucket_size 64; (or 128) inside the http block.
  2. Run nginx -t, then reload.

Got a different message? Paste it into the error explainer.

Related errors

All 19 Web servers & certificates errors