NGINX:nginx.conf配置文件
usernobody nobody; //用户和用户组worker_processes4; //指定工作进程数(一般设置为CPU总核数或2*CPU总核数)
error_loglogs/error.log crit;//错误日志路径及级别
pid logs/nginx.pid;
worker_rlimit_nofile 65535; //指定文件描述符数量
events {
use epoll; //使用网络IO模型,Linux系统采用epoll,freebsd采用kqueue
worker_connections65535;//最大连接数
}
http {
server_tokens off;
include mime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size 128;
log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_loglogs/access.logmain;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout65;
gzipon;
gzip_min_length 1k;
gzip_buffers4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/cssapplication/xml;
gzip_vary on;
include vhost/hd.conf;
}
配置文件结构如下:
......
events
{
......
}
http
{
......
server
{
......
}
server
{
......
}
......
}
页:
[1]