nginx/nginx.conf

WBOY
發布: 2016-06-07 15:06:32
原創
1042 人瀏覽過

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

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!