Drcus | 王亚振

Drcus | 王亚振

随便写,记录点东西

Nginx 增加主机名问题

发布于:  

Nginx: could not build the servernameshash 解决办法

今天给一台Nginx proxy 服务器增加主机名server_namenginx -t测试报错 大概这个样子

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

解决办法是在 nginx 配置文件的 http 段中增加如下配置:

http {
    ...
    server_names_hash_bucket_size 64; 
    ...
}

官方文档

厚颜一下 ~^_^~

赏赐