proxy_headers_hash_bucket_size

Sets the size of hash buckets for storing proxy headers in NGINX. — NGINX HTTP Core

proxy_headers_hash_bucket_size
httpserverlocation
Синтаксисproxy_headers_hash_bucket_size size;
По умолчанию32
Контекстhttp, server, location
МодульNGINX HTTP Core
Аргументы1

Описание

The `proxy_headers_hash_bucket_size` directive specifies the size of the hash buckets used for distributing proxy headers in the NGINX server. The primary purpose of this directive is to optimize the performance and memory usage of the hash table maintaining these headers, particularly in scenarios involving many proxy headers. A larger bucket size can help prevent collisions, which may enhance lookup speed when accessing these headers.

Пример конфига

http {
    proxy_headers_hash_bucket_size 64;
}

Setting the value too low can lead to performance issues due to hash collisions.

Excessively large values may waste memory, particularly for configurations with a limited number of headers.