美文网首页
Nginx:could not build optimal se

Nginx:could not build optimal se

作者: _王子_ | 来源:发表于2017-11-08 09:44 被阅读0次
[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

相关文章

网友评论

      本文标题:Nginx:could not build optimal se

      本文链接:https://www.haomeiwen.com/subject/fhlemxtx.html