昨天在nginx上部署了一个网站后,发现访问不了,再去访问之前部署的网站,发现都访问不了了,去看下下nginx,发现nginx服务停止了,没有在运行,重启了下服务,发现还是一样,就去看了下nginx的日志,发下下面这样的提示:

看到什么server_names_hash_bucket_size之类的,我猜测是部署网站的时候,起的主机名称太长了,改小后果然,重启nginx,马上就好了。

解决方案:

edit the http{} nginx configuration

http {
server_names_hash_bucket_size ;
...
}
  • The default value of server_names_hash_bucket_size depends on the size of the processor’s cache line
  • If a large number of server names are defined, or unusually long server names are defined, tuning the server_names_hash_max_size and server_names_hash_bucket_size directives at the http level may become necessary.
  • If the default value of server_names_hash_bucket_size used at the server is not enough, means nginx complained with could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32, the directive value should be increased to the next power of two (e.g. in this case to 64).
  • If a large number of server names are defined, and nginx complained with the following error could not build the server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 32. try to set server_names_hash_max_size to a number close to the number of server names. Only if this does not help, or if nginx’s start time is unacceptably long, try to increase server_names_hash_bucket_size.
  • The hash bucket size parameter is aligned to the size that is a multiple of the processor’s cache line size

nginx问题之nginx: could not build server_names_hash, you should increase server_names_hash_bucket_size解决方案的更多相关文章

  1. nginx windows could not build server_names_hash, you should increase server_names_hash_bucket_size: 32

    nginx 为windows版本 在配置文件nginx.conf 的http{}段增加一行配置 server_names_hash_bucket_size 64; 如果64不够可以设128等

  2. 【记录】Nginx错误could not build the server_names_hash you should increase server_names_hash_bucket_size: 32

    今天遇到这个错误,现记录下解决方案: 在nginx的配置文件的http段中增加如下配置: server_names_hash_bucket_size 64; 下面是nginx官方文档解释: 如果定义了 ...

  3. Cenos(6.6/7.1)下从源码安装Python+Django+uwsgi+nginx到写nginx的环境部署(一)

    梳理下这几个的关系: centos是redhat的社区版操作系统. Python2.7.5是开发语言(centos6.5下自带的python是2.6.6版本,所以需要源码更新,而centos7.1下面 ...

  4. Master Nginx(1) - Installing Nginx and Third-Party Modules

    Installing NGINX and Third-Party Modules Installing Nginx using a package manager Linux(deb-based) s ...

  5. 【夯实Nginx基础】Nginx工作原理和优化、漏洞

    本文地址 原文地址 本文提纲: 1.  Nginx的模块与工作原理    2.  Nginx的进程模型    3 . NginxFastCGI运行原理        3.1 什么是 FastCGI   ...

  6. Nginx 服务器 之Nginx与tomcat实现负载均衡

      本文讲解我们如何使用Nginx做反向带服务器,实现nginx与tomcat服务器集群做负载均衡. 一.nginx与tomcat实现负载均衡 1.在/usr/local/ngnix/conf  创建 ...

  7. Nginx配置文件(nginx.conf)配置详解(2)

    Nginx的配置文件nginx.conf配置详解如下: user nginx nginx ; Nginx用户及组:用户 组.window下不指定 worker_processes 8; 工作进程:数目 ...

  8. Nginx配置文件(nginx.conf)配置详解

    Nginx的配置文件nginx.conf配置详解如下: user nginx nginx ; Nginx用户及组:用户 组.window下不指定 worker_processes 8; 工作进程:数目 ...

  9. Nginx配置配置文件nginx.conf的设置

    引用自:http://www.ha97.com/5194.html #定义Nginx运行的用户和用户组user www www; #nginx进程数,建议设置为等于CPU总核心数.worker_pro ...

随机推荐

  1. java 判断图片的类型

    // 这种方法如果遇到不是图片类型的文件会reader抛异常! public static void main(String[] args) throws IOException { // get i ...

  2. 【代码笔记】XML深入学习:DTD约束与DTD语法(1)

    2015-12-27 文件名    student.xml <?xml version="1.0" encoding="GB2312" standalon ...

  3. C#工具类之数据库连接

    一.SQL Server /// <summary> /// 数据库的通用访问代码 /// 此类为抽象类, /// 不允许实例化,在应用时直接调用即可 /// </summary&g ...

  4. esri GDB API

    抽空研究了下API,目前1.4版本,还不错. 记录下 DatasetRelationshipTypes类型 - DatasetRelationshipTypes {string[18]} string ...

  5. android,getExternalStorageDirectory()和getExternalFilesDir()的区别

    转载地址:https://blog.csdn.net/nugongahou110/article/details/48154859 之前看到一位网友的吐槽:当我把手机连接到电脑上时,在SD卡根目录看到 ...

  6. Jmeter各部件的作用

    JMeter主要组件介绍 1.测试计划(Test Plan)是使用 JMeter 进行测试的起点,它是其它 JMeter 测试元件的容器. 2.线程组(Thread Group)代表一定数量的并发用户 ...

  7. matlab练习程序(Bresenham画线)

    Bresenham画线算图形学中最基础的知识了,可惜我并没有选修过图形学,所有还是有必要熟悉一下. 上一篇用到的画线函数应该算是数值微分法,也是我最常用的一种方法,不过这种方法似乎并不是很好. 这里的 ...

  8. (四)WebDriver常用方法

    点击和输入 前面我们已经学习了定位元素, 定位只是第一步, 定位之后需要对这个元素进行操作, 或单击(按钮) 或输入(输入框) , 下面就来认识 WebDriver 中最常用的几个方法: clear( ...

  9. SQA和测试

    一.SQA计划 (1)软件工程:设计出云医院页面和其功能. (2)质量保证:进行需求分析,使用户确信产品或服务能满足规定的质量要求. (3)质量控制:采取不断的调试完善代码和程序确保产品质量. (4) ...

  10. CentOS 6.4安装谷歌浏览器(chromium)不是chrome

    原文转载于http://www.wypblog.com/archives/782 今天给大家介绍如何在CentOS 6.4平台上面安装chromium浏览器,和Google的Chrome也类似,虽然不 ...