标签:hash etc nginx archlinux conf 安装 types size
安装nginx
sudo pacman -S nginx
查询nginx配置文件位置
sudo nginx -t
运行结果如下:
[itkey@archlinux ~]$ sudo nginx -t
2021/03/28 10:29:01 [warn] 1503#1503: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
解决警告
警告信息如下:
[warn] 1503#1503: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
解决办法:
修改 /etc/nginx/nginx.conf 配置文件,增加
# 长连接超时时间,单位是秒
types_hash_max_size 4096;
这下运行就没有警告啦!
运行结果如下:
[itkey@archlinux ~]$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf
syntax is ok
nginx: configuration file /etc/nginx/nginx.conf
test is successful
没有警告就是开心。
修改配置以后重启 nginx
nginx -s reload
重启报错解决办法
服务器重启之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错
nginx: [error] invalid PID number “” in “/run/nginx.pid”
解决方法:
需要先执行
nginx -c /etc/nginx/nginx.conf
nginx.conf文件的路径可以从nginx -t的返回中找到。
nginx -s reload
参考
标签:hash,etc,nginx,archlinux,conf,安装,types,size 来源: https://blog.csdn.net/lxyoucan/article/details/115278646
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。