文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>nginx配置详解

nginx配置详解

时间:2010-10-09  来源:lm870403

 #使用哪个用户启动nginx 前面是用户,后面是组
user  www www;

#nginx工作的进程数量
worker_processes 2;工作进程数,一般与 CPU 核数等同

# [ debug | info | notice | warn | error | crit ]   错误日志的位置
error_log  /var/htdocs/logs/nginx_error.log  crit;

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

#最大文件描述符 ?有待继续整理.
worker_rlimit_nofile 51200;

events
{
     # use [ kqueue | rtsig | epoll | /dev/poll | select | poll ];
     use epoll;  #使用epoll(linux2.6的高性能方式)
     worker_connections 51200; #每个进程最大连接数(最大连接=连接数x进程数)
}

http
{
     #文件扩展名与文件类型映射表
     include       mime.types;
 
     #默认文件类型
     default_type  application/octet-stream;
 
     #日志文件格式
     log_format  main  '$remote_addr - $remote_user [$time_local] $request '
                  '"$status" $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';


    log_format download  '$remote_addr - $remote_user [$time_local] '
                             '"$request" $status $bytes_sent '
                             '"$http_referer" "$http_user_agent" '
                             '"$http_range" "$sent_http_content_range"';

     #默认编码
     charset  gb2312,utf-8;
    
     server_names_hash_bucket_size 128;
     #开启高效文件传输模式
     sendfile on;
     #以下两个选项用于防止网络阻塞 参考

相关阅读 更多 +
排行榜 更多 +
枪战大乱斗2

枪战大乱斗2

飞行射击 下载
猎鸭挑战安卓版

猎鸭挑战安卓版

飞行射击 下载
空军

空军

飞行射击 下载