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

**Code:** `could not build the server_names_hash, you should increase server_names_hash_bucket_size` · **Category:** Nginx / Apache · **Seen on:** Nginx, Linux

A very long `server_name` (or many names) doesn't fit the hash bucket.

## Meaning

Add `server_names_hash_bucket_size 128;` (or 64/256) to the `http {}` block; raise `server_names_hash_max_size` if you have thousands of names. Typical with long domain names or many virtual hosts on one server.

## Common causes

- Very long domain/server_name
- Hundreds of server names
- Default bucket size 32/64 too small
- Wildcard/regex names
- Generated vhosts

## Quick fix

1. In `http {}`: `server_names_hash_bucket_size 128;`
2. Increase `server_names_hash_max_size` for many names
3. Reload after `nginx -t`

## Detailed fix by platform

### Nginx

1. `http { server_names_hash_bucket_size 128; }`

## How to diagnose

1. **Names** — Long/many?
2. **Bucket** — Current value?
3. **Fix** — Increase in http?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nginx-apache/nginx-could-not-build-server-names-hash)
