Opened 11 years ago
Closed 11 years ago
#631 closed enhancement (wontfix)
server_names_hash_bucket_size seems too low by default
Reported by: | Alexander Shtuchkin | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.7.x |
Keywords: | Cc: | ||
uname -a: | Linux DigitalOcean1 3.2.0-23-virtual #36-Ubuntu SMP Tue Apr 10 22:29:03 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux | ||
nginx -V: |
nginx version: nginx/1.7.5
TLS SNI support enabled configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.7.5/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.7.5/debian/modules/nginx-dav-ext-module --add-module=/build/buildd/nginx-1.7.5/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.7.5/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.7.5/debian/modules/ngx_http_substitutions_filter_module |
Description
I'm using nginx on Digital Ocean with default Ubuntu distribution and nginx development ppa. I also saw the same behavior on multiple other cloud providers.
The problem is that even when serving small number of domains (~3-5), nginx gives me the [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
error and I have to change otherwise perfect default configuration.
Can you make the size of server name hash larger by default, or, even better, calculate optimal size at runtime? Pretty annoying that the server cannot determine such things by itself.
This is probably related to #352.
The name you are trying to use is likely larger than what fits into 32 bytes - which is the optimal size as calculated by nginx according to CPU ID.