27 Nginx的events块指令的配置使用

27 Nginx的events块指令的配置使用

27.1 events指令配置实例

# 内核版本 2.6以上,添加events参数配置,并重启
[root@nginx-100 ~]# uname -a
Linux nginx-100 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@nginx-100 ~]# cat /usr/local/nginx/conf/nginx.conf
..........
events {
    accept_mutex on;
    multi_accept on;
    worker_connections  1024;
    use epoll;
}
..........
[root@nginx-100 ~]# /usr/local/nginx/sbin/nginx -t && /usr/local/nginx/sbin/nginx -s reload
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

浏览器访问:http://10.0.0.100/ 正常

image

———————————————————————————————————————————————————————————————————————————

                                                                                                                         无敌小马爱学习

posted on 2026-04-14 22:17  马俊南  阅读(6)  评论(0)    收藏  举报