zoukankan      html  css  js  c++  java
  • Nginx: could not build the server_names_hash 解决办法

    转载自: http://www.tuicool.com/articles/NZVnm2f

    上周给一台 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;
      ...
    }
    ...
  • 相关阅读:
    刚好遇见你——软件工程
    int main(int argc,char* argv[]) 简单理解
    奇偶数分离
    A+B Problem
    日期计算
    正三角形的外接圆面积
    数数小木块
    谁是最好的Coder
    水仙花数
    5个数求最值
  • 原文地址:https://www.cnblogs.com/mingaixin/p/4708912.html
Copyright © 2011-2022 走看看