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



ERROR
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
Std ERROR
nginx: [warn] conflicting server name "www.test.medcons24.de" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "test.medcons24.de" on 0.0.0.0:80, ignored
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
Check the output for the following command
$ sudo ls /usr/local/openresty/nginx/sites/ 
OUTPUT
default medcon-test.conf medcontest.conf wpmedcon.conf
Check the output for the following command
$ sudo grep -H server_name /usr/local/openresty/nginx/sites/*|sort|uniq 
OUTPUT
/usr/local/openresty/nginx/sites/default:	server_name _;
/usr/local/openresty/nginx/sites/medcon-test.conf: server_name test.medcons24.de;
/usr/local/openresty/nginx/sites/medcontest.conf: server_name test.medcons24.de;
/usr/local/openresty/nginx/sites/medcon-test.conf: server_name www.test.medcons24.de;
/usr/local/openresty/nginx/sites/medcontest.conf: server_name www.test.medcons24.de;
/usr/local/openresty/nginx/sites/wpmedcon.conf: server_name wptest.medcons24.de;
/usr/local/openresty/nginx/sites/wpmedcon.conf: server_name www.wptest.medcons24.de;
Check the output for the following command
$ sudo openresty -t 
OUTPUT
nginx: the configuration file /usr/local/openresty/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test is successful
Now RUN the following command
$ sudo service openresty restart 
AND FINALLY, add 64 in Nginx config Now RUN the following command
$ sudo nano /usr/local/openresty/nginx/conf/nginx.conf 
And within the http section add the following line
server_names_hash_max_size 64; 
now delete the sites config files again:
& sudo rm /usr/local/openresty/nginx/sites/*.conf
And:
$ sudo service openresty restart
Selim Reza

Site Footer