Nginx 专题

发布时间: 更新时间: 总字数:314 阅读时间:1m 作者: 分享 复制网址

Nginx是一款轻量级的Web服务器/反向代理服务器,特点是占有内存少,并发能力强,并发能力在同类型的网页服务器中表现较好。

介绍

安装Nginx

# CentOS/Redhat
yum install nginx -y

# Ubuntu
apt install nginx -y

命令

systemctl start nginx
systemctl restart nginx
systemctl stop nginx
systemctl reload nginx

reload 说明

  • systemctl reload nginx 时,原有的链接不会中断,参考如下:
Old worker processes close listen sockets and continue to service old clients. After all clients are serviced, old worker processes are shut down.

老的工作进程关闭监听套接字,继续为老客户提供服务。在所有客户都得到服务后,旧的工作进程将被关闭。
  • nginx -s reload 之后,nginx 开始平滑的重启,nginx: worker process is shutting down 的进程处理完当前连接后会杀死重建,通过 worker_shutdown_timeout 1h; 配置重启的超时时长
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数