您当前的位置: 首页 >  ar

ITKEY_

暂无认证

  • 0浏览

    0关注

    732博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

archlinux安装nginx

ITKEY_ 发布时间:2021-03-28 12:49:44 ,浏览量:0

安装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
参考

https://stackoverflow.com/questions/46031491/nginx-on-fedora-26-could-not-build-optimal-types-hash-error-message

关注
打赏
1665243900
查看更多评论
立即登录/注册

微信扫码登录

0.0383s