nginx 配置若干问题
配置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 配置若干问题的更多相关文章
- nginx配置入门
谢谢作者的分享精神,原文地址:http://www.nginx.cn/591.html nginx配置入门 之前的nginx配置是对nginx配置文件的具体含义进行讲解,不过对于nginx的新手可能一 ...
- nginx配置学习文章
partOne 自我释义部分 我的是阿里云的ubuntu *******实际上感觉这里是基本配置,很用不到*********#定义其用户或用户组user www-data;#nginx的进程数,应当为 ...
- nginx 配置入门
之前的nginx配置是对nginx配置文件的具体含义进行讲解,不过对于nginx的新手可能一头雾水. 今天看到个文档不错,翻译过来分享给大家,可以让新手更详细地了解nginx配置,可以说是nginx配 ...
- Nginx配置了解
安装Nginx常用编译选项说明 nginx大部分常用模块,编译时./configure --help查看,以--without开头的都是默认安装. --prefix=PATH 指定nginx的安装目录 ...
- 【nginx】nginx配置文件结构,内置变量及参数调优
Nginx的配置文件是一个纯文本文件,它一般位于Nginx安装目录的conf目录下,整个配置文件是以block的形式组织的.每个block一般以一个大括号“{”来表示.block 可以分为几个层次,整 ...
- Nginx配置杂记(转)
转至:http://www.cnblogs.com/kuangke/p/5619400.html Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器,相较 ...
- 你需要知道的Nginx配置二三事
做服务端开发的,工作中难免会遇到处理Nginx配置相关问题.在配置Nginx时,我一直本着“照葫芦画瓢”的原则,复制已有的配置代码,自己修修改改然后完成配置需求,当有人问起Nginx相关问题时,其实仍 ...
- Nginx配置Https指南
前言 本文是对Nginx配置SSL证书的总结. 申请SSL证书 你可以从任何证书提供商处申请证书,这里以阿里云为例. 打开阿里云SSL证书控制台,点击购买证书 选择免费型一年期的证书,点击立即购买 注 ...
- nginx配置反向代理或跳转出现400问题处理记录
午休完上班后,同事说测试站点访问接口出现400 Bad Request Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...
随机推荐
- 采集电脑摄像头和mic,rtp端口推送音视频工具
介绍:这个是我在做一个rtmp播放的项目中自己写的rtp推送的工具,可选择摄像头,可选择推送rtp的端口和ip 下载地址: github:https://github.com/alexhegang/s ...
- XML学习(一)——xml内容简介
一.什么是XML xml全称为Extensible Markup Language,意思是可扩展的标记语言.XML语法上和HTML比较相似,但是HTML中的元素是固定的,而XML的标签是可以用户定义的 ...
- load多个数据文件的yaml
VERSION: 1.0.0.1DATABASE: testUSER: adminHOST: node31PORT: 5432GPLOAD: INPUT: - SOURCE: LOCAL_HOSTNA ...
- hiho1116 - 数据结构 线段树(区间合并)
题目链接 现在有一个有n个元素的数组a1, a2, ..., an. 记f(i, j) = ai * ai+1 * ... * aj. 初始时,a1 = a2 = ... = an = 0,每次我会修 ...
- HDU 1285 确定比赛名次【拓扑排序】
题意:中文的题目-----这道题让我终于明白了那个break的作用---因为题目中有这一句“符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前”@_@ #include<iostrea ...
- + (void)initialize vs 静态构造方法
在继承体系中,多个子类的引用,父类缺省执行一次: 特殊情况: 1)子类没有实现.调用父类方法: 2)子类显示调用父类: 3)存在分类实现,分类实现覆盖本体. Initializes the class ...
- rem — 一个低调的css单位
原文 http://www.zhaoan.org/1825.html rem这是个低调的 css 单位,近一两年开始崭露头角,有许多同学对rem的评价不一,有的在尝试使用,有的在使用过程中遇到坑就弃 ...
- Win7+VS2010:mysql 源代码编译与调试
win7+vs2010源代码编译mysql 近期因为在实习,工作重点在于一些数据库的开发,为了更好的理解数据库的实现机制.眼下萌生了要研究一下mysql数据库源代码的想法.那么好吧,说干就干.首先我们 ...
- ios的notification机制是同步的还是异步的
与javascript中的事件机制不同.ios里的事件广播机制是同步的,默认情况下.广播一个通知,会堵塞后面的代码: -(void) clicked { NSNotificationCenter *c ...
- Dynamics CRM2013 Form利用window.location.reload()进行全局刷新带来的问题及解决的方法
CRM2013以后.表单的保存后变成了局部刷新而非全局刷新,但非常多情况下我们须要刷新整个页面.通过刷新页面来使脚本运行或者业务规则运行来实现某些业务效果,一般我们会使用window.location ...