nginx/nginx.conf

php中文网
发布: 2016-06-07 15:06:32
原创
1279人浏览过

#使用小号 usernobody; #开启进程数 worker_processes8; #制定进程到cpu(四cpu:0001 0010 0100 1000) worker_cpu_affinity 0001 0010 0100 1000 0001 0010 0100 1000; #每个进程最大打开文件数 worker_rlimit_nofile 10240; #进程号保存文件 pidlogs/ngin

#使用小号
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;
}

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号