昨天在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. scss-颜色运算符

    scss允许使用颜色分量以及算术运算和任何颜色表达式返回颜色值. 例如scss代码: $color1: #333399; $color2: #CC3399; p{ color: $color1 + $ ...

  2. JavaScript入门几个概念

    JavaScript入门几个概念 刚刚入门JavaScript的时候,搞懂DOM.BOM以及它们的对象document和window很有必要. DOM是为了操作文档出现的API,document是它的 ...

  3. react里面stateless函数的默认参数

    function fn({  children,  params,  dispatch,  location}) { }

  4. 数据结构复习之C语言指针与结构体

    数据结构指针复习: #include <stdio.h> void main() { ] = {, , , , }; // a[3] == *(3+a) printf(+a)); // a ...

  5. window.frames在不同浏览器中的用法

    document.frames 等同于 window.frames,用来取得当前页面内 window 对象的集合. 不支持Firefox,其他浏览器(chrome.opera.IE.360)均支持. ...

  6. ArcGIS图框生成和批量打印工具 5.2支持国家2000坐标系,支持ArcGIS10.1、ArcGIS10.2,输出图片可以是TIF和JPG

    主要两个功能有:生成图框.批量输出MXD和JPG http://files.cnblogs.com/gisoracle/ScalePrint.rar 1.        批量生成标准分幅图或行政区划, ...

  7. 设计模式之简单工厂模式(Simple Factory)

    原文地址:http://www.cnblogs.com/BeyondAnyTime/archive/2012/07/06/2579100.html 今天呢,要学习的设计模式是“简单工厂模式”,这是一个 ...

  8. mysql_01_游标的使用

    一.表的创建 1.直接创建表 DROP TABLE IF EXISTS shops_info; /*EMP产品版本版本信息表*/ CREATE TABLE shops_info ( ID INT PR ...

  9. Git warning push.default is unset

    warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple ...

  10. spring boot 三种入参

    先来讲述下最简单的使用get请求用户信息的实现方式,代码如下,写好后直接在Application类点击右键有个RunAs,点击后会自动运行,运行成功后可以使用http发包工具进行测试,这里推荐使用ch ...