上周给一台 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
樱花校园模拟器解锁版
樱花校园模拟器完整版,一个玩过的玩家都说好的手机游戏。这里采
模拟农场15手游
模拟农场15呈现真实的田园管理体验。在这片广阔的土地上,可以
我叫包租婆红包版
我叫包租婆红包版是一款非常经典的模拟休闲类手机游戏,玩家将在
盖瑞模组可以加模组的版本
盖瑞模组游戏是一款沙盒建造类游戏,自由建造专属场地,在游戏过
星露谷物语美化包mod手机版
星露谷物语美化版汉化版是一个高度自由的像素农场经营类小游戏,