Nginx优化

Nginx 隐藏版本

查看方法

[root@localhost bbs]# curl -I http://192.168.235.133

在这里插入图片描述

[root@localhost conf]# vim nginx.conf

在这里插入图片描述

[root@localhost conf]# systemctl restart nginx
[root@localhost conf]# curl -I http://192.168.235.133

在这里插入图片描述

[root@localhost nginx-1.15.9]# ./configure \
> --prefix=/usr/local/nginx \
> --user=nginx \
> --group=nginx \
> --with-http_stub_status_module
make && make install
[root@localhost nginx-1.15.9]# vim /usr/local/nginx/conf/nginx.conf

在这里插入图片描述

[root@localhost nginx-1.15.9]# systemctl stop nginx
[root@localhost nginx-1.15.9]# systemctl start nginx
[root@localhost nginx-1.15.9]# curl I http://192.168.235.133

在这里插入图片描述

设置缓存时间

[root@localhost nginx-1.15.9]# vim /usr/local/nginx/conf/nginx.conf

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

[root@localhost html]# vim index.html 

在这里插入图片描述

[root@localhost html]# systemctl restart nginx[root@localhost html]# curl I http://192.168.235.133/cat.jpg

在这里插入图片描述

日志分割

[root@localhost opt]# vim fenge.sh

在这里插入图片描述

[root@localhost opt]# systemctl start nginx[root@localhost opt]# netstat -natp | grep nginx

在这里插入图片描述

[root@localhost opt]# chmod +x fenge.sh

在这里插入图片描述

[root@localhost opt]# ls /var/log/nginx

在这里插入图片描述

[root@localhost opt]# crontab -ecrontab: installing new crontab

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值