Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx: you should increase server_names_hash_bucket_size: 32 - did this but no effect

Tags:

nginx

When I run nginx -t

I get error

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

Then I go and update nginx.conf file, line server_names_hash_bucket_size to 32.

Then I run service nginx reload

Then run again nginx -t and I am getting the same error.

Why it does not take effect and how could I fix this?

like image 824
Dariux Avatar asked Oct 14 '14 09:10

Dariux


2 Answers

Setting to 64 does not throw this error anymore. Probably it was showing current value - 32 which was not enough.

like image 173
Dariux Avatar answered Oct 04 '22 21:10

Dariux


In nginx 1.14, there is no default settings in nginx.conf, so add the server_names_hash_bucket_size 64; into http

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    server_names_hash_bucket_size 64;
like image 42
herbertD Avatar answered Oct 04 '22 19:10

herbertD