Skip to content

Instantly share code, notes, and snippets.

@SherryQueen
Created August 25, 2017 06:18
Show Gist options
  • Select an option

  • Save SherryQueen/fba15790c1f04bf324448deba3fb4a3d to your computer and use it in GitHub Desktop.

Select an option

Save SherryQueen/fba15790c1f04bf324448deba3fb4a3d to your computer and use it in GitHub Desktop.
nginx 配置
user www-data; # 用户组
worker_processes 2; # 工作核心
# 进程id位置
pid /run/nginx.pid;
events {
use epoll; # 设置工作模式
worker_connections 768; # 单进程最大连接数
}
http {
#主模块指令,实现对配置文件所包含的文件的设定,可以减少主配置文件的复杂度,DNS主配置文件中的zonerfc1912,acl基本上都是用include语句。
include mime.types;
include /etc/nginx/conf.d/*.conf;
#核心模块指令,智力默认设置为二进制流,也就是当文件类型未定义时使用这种方式
default_type application/octet-stream;
#引用日志
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
#开启高效文件传输模式
sendfile on;
#开启防止网络阻塞
tcp_nopush on;
#开启防止网络阻塞
tcp_nodelay on;
#设置客户端连接保存活动的超时时间
keepalive_timeout 65;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment