nginx.conf文件配置说明

#使用小号
user nobody;

#开启进程数
worker_processes 8;

#制定进程到cpu(四cpu:0001 0010 0100 1000)
worker_cpu_affinity 0001 0010 0100 1000 0001 0010 0100 1000;

#每个进程最大打开文件数
worker_rlimit_nofile 10240;

#进程号保存文件
pid logs/nginx.pid;

events {
#使用epoll(linux2.6的高性能方式)
use epoll;
#每个进程最大连接数(最大连接=连接数x进程数)
worker_connections 10240;
}

http {

#文件扩展名与文件类型映射表
include mime.types;

#默认文件类型
default_type text/html;

#日志文件格式
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 /dev/null;

#长链接超时时间
keepalive_timeout 30;

#打开gzip压缩
gzip on;
#最小压缩文件大小
gzip_min_length 1000;
#压缩缓冲区
gzip_buffers 4 8k;
#压缩类型
gzip_types text/* text/css application/javascript application/x-javascript;
#压缩比率
gzip_comp_level 9;
#压缩通过代理的所有文件
gzip_proxied any;
#vary header支持
gzip_vary on;
#压缩版本(默认1.1,前端为squid2.5使用1.0)
gzip_http_version 1.0;
#输出缓冲区
output_buffers 4 32k;
#输出拆包大小
postpone_output 1460;

#接收header的缓冲区大小
client_header_buffer_size 128k;
large_client_header_buffers 4 256k;

#客户端发送header超时
client_header_timeout 1m;
#客户端发送内容超时
client_body_timeout 1m;
#发送到客户端超时
send_timeout 1m;
#开启高效文件传输模式
sendfile on;
#捕捉代理端的http错误
#proxy_intercept_errors on;
#默认编码
charset GBK;

#默认域名(不能访问)
server {include port.conf;server_name null;location / {root /dev/null;log_not_found off;}}

#嵌套upstream.conf
include upstream.conf;

#嵌套servers/*.com;
include servers/*.com;
include servers/*.net;
include servers/*.org;
include servers/*.com.cn;
include servers/*.cn;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值