idealista / nginx_role

Ansible role to install nginx http and reverse proxy server
7 stars 2 forks source link

[FEATURE] Add server_names_hash_bucket_size option in nginx.conf template #88

Closed frantsao closed 3 years ago

frantsao commented 3 years ago

Description

server_names_hash_bucket_size is an option with default value depending on CPU architecture: http://nginx.org/en/docs/http/server_names.html

_If a large number of server names are defined, or unusually long server names are defined, tuning the server_names_hash_max_size and server_names_hash_bucket_size directives at the http level may become necessary. The default value of the server_names_hash_bucketsize directive may be equal to 32, or 64, or another value, depending on CPU cache line size.

Why is this needed?

Working with the same configuration on different infrastructure, the service may or may not start, depending on the configuration and the CPU architecture. It is interesting to have that value defined if you want to have the same behavior on different infrastructures. A common error in this situation is: Nginx:[emerg] could not build serve server_names_hash_bucket_size: 32 Nginx gives an error