配置nginx,遇到的几个小问题:

1、

报错信息:

# nginx -t

nginx: [warn] conflicting server name "test.hjq.com" on 0.0.0.0:, ignored

分析解决:

配置文件中,重复配置了server name : test.hjq.com 。

检查配置文件,去掉重复的,只保留唯一server name。

2、

报错信息:

# nginx -t 

nginx: [emerg] could not build the server_names_hash, you should increase either server_names_hash_max_size:  or server_names_hash_bucket_size: 64  

分析解决:

server_name  后配置了过多或过长的域名时,会报这个错。

官网有关这问题的说明:

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.
The default value of the server_names_hash_bucket_size directive may be equal to 32, or 64, or another value, depending on CPU cache line size.
If the default value is 32 and server name is defined as “too.long.server.name.example.org” then nginx will fail to start and display the error message:
  could not build the server_names_hash,
  you should increase server_names_hash_bucket_size:
32
In this case, the directive value should be increased to the next power of two:
  http {
  server_names_hash_bucket_size
64;
  ...

If a large number of server names are defined, another error message will appear:
  could not build the server_names_hash,
  you should increase either server_names_hash_max_size:
512
  or server_names_hash_bucket_size: 32

In such a case, first 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.

官方解析:http://nginx.org/en/docs/http/server_names.html

nginx 配置若干问题的更多相关文章

  1. nginx配置入门

    谢谢作者的分享精神,原文地址:http://www.nginx.cn/591.html nginx配置入门 之前的nginx配置是对nginx配置文件的具体含义进行讲解,不过对于nginx的新手可能一 ...

  2. nginx配置学习文章

    partOne 自我释义部分 我的是阿里云的ubuntu *******实际上感觉这里是基本配置,很用不到*********#定义其用户或用户组user www-data;#nginx的进程数,应当为 ...

  3. nginx 配置入门

    之前的nginx配置是对nginx配置文件的具体含义进行讲解,不过对于nginx的新手可能一头雾水. 今天看到个文档不错,翻译过来分享给大家,可以让新手更详细地了解nginx配置,可以说是nginx配 ...

  4. Nginx配置了解

    安装Nginx常用编译选项说明 nginx大部分常用模块,编译时./configure --help查看,以--without开头的都是默认安装. --prefix=PATH 指定nginx的安装目录 ...

  5. 【nginx】nginx配置文件结构,内置变量及参数调优

    Nginx的配置文件是一个纯文本文件,它一般位于Nginx安装目录的conf目录下,整个配置文件是以block的形式组织的.每个block一般以一个大括号“{”来表示.block 可以分为几个层次,整 ...

  6. Nginx配置杂记(转)

    转至:http://www.cnblogs.com/kuangke/p/5619400.html Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器,相较 ...

  7. 你需要知道的Nginx配置二三事

    做服务端开发的,工作中难免会遇到处理Nginx配置相关问题.在配置Nginx时,我一直本着“照葫芦画瓢”的原则,复制已有的配置代码,自己修修改改然后完成配置需求,当有人问起Nginx相关问题时,其实仍 ...

  8. Nginx配置Https指南

    前言 本文是对Nginx配置SSL证书的总结. 申请SSL证书 你可以从任何证书提供商处申请证书,这里以阿里云为例. 打开阿里云SSL证书控制台,点击购买证书 选择免费型一年期的证书,点击立即购买 注 ...

  9. nginx配置反向代理或跳转出现400问题处理记录

    午休完上班后,同事说测试站点访问接口出现400 Bad Request  Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...

随机推荐

  1. [luogu P2123] 皇后游戏 解题报告(贪心)

    题目链接:https://www.luogu.org/problemnew/show/P2123 题目大意: 给定a数组和b数组,要求最小化c数组中的最大值 题解: 考虑微扰法,推一波式子先 设$x= ...

  2. html5+css3+javascript 自定义弹出窗口

    效果图: 源码: 1.demo.jsp <%@ page contentType="text/html;charset=UTF-8" language="java& ...

  3. 《鸟哥的Linux私房菜》笔记——01. 计算机概论

    计算机的五大部分:输入单元.输出单元.CPU(控制单元(Control Unit).算数逻辑单元(ALU)).内存. CPU 的架构 精简指令集(Reduced Instruction Set Com ...

  4. exsi中的虚拟机添加磁盘后虚拟机中磁盘不出现

    exsi中的虚拟机添加磁盘后虚拟机中磁盘不出现解决: 计算机---> 管理: 这里可以选择磁盘,格式,分区, 改盘符等操作

  5. SpringCloud学习笔记(10)----Spring Cloud Netflix之声明式 REST客户端 -Feign的高级特性

    1. Feign的默认配置 Feign 的默认配置 Spring Cloud Netflix 提供的默认实现类:FeignClientsConfiguration 解码器:Decoder feignD ...

  6. matplotlib bar函数重新封装

    参考: https://blog.csdn.net/jenyzhang/article/details/52047557 https://blog.csdn.net/liangzuojiayi/art ...

  7. SP687 REPEATS - Repeats(后缀数组)

    一个初步的想法是我们枚举重复子串的长度\(L\).然后跑一遍SA.然后我们枚举一个点\(i\),令他的对应点为\(i+L\),然后求出这两个点的LCP和LCS的长度答案就是这个点的答案就是\((len ...

  8. 30 个实例详解 ,让运维彻底搞清TOP 命令!

    Linux中的top命令显示系统上正在运行的进程.它是系统管理员最重要的工具之一.被广泛用于监视服务器的负载.在本篇中,我们会探索top命令的细节.top命令是一个交互命令.在运行top的时候还可以运 ...

  9. [Angular + TsLint] Disable directive selector tslint error

    @Directive({ // tslint:disable-next-line:directive-selector selector: '[scrollable]' })

  10. Android Bitmap太大导致ImageView不显示的问题

    今天做我们的智能相冊的项目时,遇到了非常奇妙的问题,当照片太大时,导致ImageView.setImageBitmap不显示,上网上搜了非常多办法.感觉都不是那么靠谱.最后使用了简单粗暴的手段: // ...