处理nginx server_names 名称过长提示


问题描述

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: [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

解决方案

修改 /etc/nginx/nginx.conf 配置中的server_names_hash_bucket_size项:

server_names_hash_bucket_size 128;
sudo service nginx restart
sudo /usr/sbin/nginx -s reload

参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录