[root@localhost sbin]# ./nginx -t
nginx: [warn] could not build optimal server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64; ignoring server_names_hash_bucket_size
解決方法是在 nginx 配置文件的 http 段中增加如下配置:
[root@localhost conf]# vi nginx.conf
...
http {
...
server_names_hash_max_size 512;
server_names_hash_bucket_size 128;
...
}
...
esc鍵设易,輸入:wq #保存退出
重新輸入nginx -t 校驗配置文件:
[root@localhost sbin]# ./nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful