zoukankan      html  css  js  c++  java
  • nginx 配置若干问题

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

    1、

    报错信息:

    # nginx -t
    
    nginx: [warn] conflicting server name "test.hjq.com" on 0.0.0.0:80, 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: 512 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

  • 相关阅读:
    Java硬件同步机制Swap指令模拟+记录型信号量模拟
    算法(第四版)练习 1.1.26 ~ 1.1.31
    C++ 电路布线/最短路径问题
    线性代数笔记
    算法导论(第三版)练习 2.2-1 ~ 2.2-4
    条款45: 弄清C++在幕后为你所写、所调用的函数
    条款42: 明智地使用私有继承
    条款41: 区分继承和模板
    【python】字符遍历
    【python】range的用法
  • 原文地址:https://www.cnblogs.com/hjqjk/p/5645509.html
Copyright © 2011-2022 走看看