最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Nginx: 提示 could not build the server_names_hash 错误如何解决
时间:2022-06-30 18:36:07 编辑:袖梨 来源:一聚教程网
上周给一台 Nginx proxy 服务器增加一个虚拟主机名(server_name)后重启 nginx 报错,nginx -t 测试和查看 nginx 错误日志均发现需要增加 server_names_hash_bucket_size 的默认参数:
# /etc/init.d/nginx reload
* Reloading nginx configuration nginx [fail]
# nginx -t
nginx: [emerg] could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
nginx: configuration file /etc/nginx/nginx.conf test failed
# tail /var/log/nginx/error.log
2015/01/28 10:21:51 [emerg] 22362#0: could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64
解决办法是在 nginx 配置文件的 http 段中增加如下配置:
# vi /etc/nginx/nginx.conf
...
http {
...
server_names_hash_max_size 512;
server_names_hash_bucket_size 128;
...
}
...
Nginx 官方文档关于 server_names_hash_max_size 和 server_names_hash_bucket_size 这两个参数的用法解释的很清楚。
官方链接: http://*ngin*x.or*g/cn/docs/http/server_names.html
相关文章
- 免费看全本漫画app推荐-无广告免费看漫画app精选 03-28
- jk漫画最新版本下载入口在哪-jk漫画官方正版下载永久防失效地址 03-28
- 《Pokemon TCG Pocket》隐藏闪光梦幻徽章 解锁难度极高 03-28
- 《头号禁区》奥义效果介绍 03-28
- 六级准考证打印入口-六级准考证打印官网 03-28
- 洛克王国世界大耳帽兜强度分析 洛克王国世界大耳帽兜实战表现与阵容适配性详解 03-28