user nginx; # 设置Nginx运行时的用户和用户组
worker_processes auto; # 设置Nginx worker进程的数量
error_log /var/log/nginx/error.log warn; # 定义错误日志的路径和级别
pid /run/nginx.pid; # 定义Nginx主进程的PID文件位置
events {
worker_connections 1024; # 设置每个worker进程的最大连接数
}
http {
include /etc/nginx/mime.types; # 引入mime.types文件
default_type application/octet-stream; # 设置默认MIME类型
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; # 设置日志输出格式
access_log /var/log/nginx/access.log main; # 定义访问日志路径和格式
sendfile on; # 启用sendfile特性
tcp_nopush on; # 启用TCP NOPUSH特性
tcp_nodelay on; # 启用TCP NODELAY特性
keepalive_timeout 65; # 客户端连接空闲超时时间
client_max_body_size 10m; # 设置客户端请求的最大请求体大小
include /etc/nginx/conf.d/*.conf; # 引入conf.d目录下的配置文件
include /etc/nginx/sites-enabled/*; # 引入sites-enabled目录下的配置文件
}
请输入评论内容: