Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx problem: Increase server_names_hash_bucket_size #124

Open
ekansa opened this issue Jul 1, 2017 · 5 comments
Open

Nginx problem: Increase server_names_hash_bucket_size #124

ekansa opened this issue Jul 1, 2017 · 5 comments

Comments

@ekansa
Copy link

ekansa commented Jul 1, 2017

I'm just now playing with a fresh install on a Ubuntu 16.10 server. I get the following error message from nginx:

nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64
Any tips on alter the configuration? The server doesn't respond at all.

@ekansa ekansa changed the title Nig nginx problem Jul 1, 2017
@ekansa
Copy link
Author

ekansa commented Jul 4, 2017

Found my problem. I used a shorter domain name. so Nginx won't freak out. But you may want to consider this issue with a warning or some logic to configure Nginx.

@vladimir-MS
Copy link

Came upon the same issue, but not in testing but with a real domain name that cannot be changed.

Longest out of three required sub-domain names is 27 characters long, and the domain itself is 22 chars long, i.e. kobo.123456789abcdefghi.org.

The solution is to edit your nginx/nginx_site_https.conf.tmpl and add the following line in the base level, for example right after charset directive:

server_names_hash_bucket_size 64;

@tinok
Copy link
Member

tinok commented Nov 22, 2017

Interesting. Our hosted server at kobo.humanitarianresponse.info is using a 31 character-long domain, using this docker installation.

cc @noliveleger

@vladimir-MS
Copy link

Indeed.

Host system in question is Debian GNU/Linux 9.2 (stretch) with minimal number of packages. kobo-docker is latest as of this time, fresh images pulled, operating normally.

Yet without increasing server_names_hash_bucket_size to 64, nginx container loops at startup with

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

@jnm jnm added the help wanted label Oct 4, 2018
@jnm
Copy link
Member

jnm commented Oct 4, 2018

Apparently "The default value depends on the size of the processor’s cache line" (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_names_hash_bucket_size).

I'm not sure if there are any disadvantages to increasing this across the board. If anyone wants to do the research and submit a PR, I'd be happy to merge it.

@noliveleger noliveleger changed the title nginx problem N ginx problem: Increase server_names_hash_bucket_size Jul 30, 2019
@noliveleger noliveleger changed the title N ginx problem: Increase server_names_hash_bucket_size Nginx problem: Increase server_names_hash_bucket_size Jul 30, 2019
@noliveleger noliveleger self-assigned this Jul 30, 2019
@noliveleger noliveleger assigned rroux and unassigned noliveleger Mar 18, 2020
@jnm jnm unassigned rroux Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants