nginx.conf 配置文件中文说明

来源:互联网 发布:unity3d 添加模型 编辑:程序博客网 时间:2024/05/22 03:11

  1. ###############################nginx.conf 配置文件中文说明  
  2. #user  nobody;                  # user 主模块指令,指令nginx worker 运行用户和用户组(user xxxuser xxxgroup) ,默认由nobody运行  
  3. worker_processes  1;            # worker_processes 主模块指令,指令nginx运行进程数,每个进程平均耗10m-12m内存,单核为1,多核为n  
  4.   
  5. #error_log  logs/error.log;     # 全局日志 输出级别debug,info,notice,warn,error,crit ,其中debug输出日志最为详细  
  6. #error_log  logs/error.log  notice; #级别 notice  
  7. #error_log  logs/error.log  info;   #级别 info  
  8.   
  9. #pid        logs/nginx.pid;     #pid 指令  指定进程id存储位置  
  10.   
  11.   
  12. events {  
  13.     worker_connections  1024;   #events 指令 指令nginx 工作模式和连接数上限  
  14. }  
  15.   
  16.   
  17. http {                                  #http服务器配置  
  18.     include       mime.types;           #包含文件mime.types  
  19.     default_type  application/octet-stream;  #默认为二进制流  
  20.   
  21.     #日志格式的设定  
  22.     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '  #HttpLog模块指令,日志输出格式,main为日志名称,可以在access_log指令引用  
  23.     #                  '$status $body_bytes_sent "$http_referer" '  
  24.     #                  '"$http_user_agent" "$http_x_forwarded_for"';  
  25.       
  26.   
  27.     #access_log  logs/access.log  main;  
  28.   
  29.     sendfile        on;   #高效文件传输模式,将tcp_nopush和tcp_nodely设置为on  
  30.     #tcp_nopush     on;  
  31.   
  32.     #keepalive_timeout  0;  #客户端连接保持活动的超时时间,超时后关闭连接  
  33.     keepalive_timeout  65;         
  34.   
  35.     #gzip  on;  #开启gzip压缩  实时压缩输出数据流  
  36.   
  37.     #server虚拟主机配置  
  38.     server {  
  39.         listen       80;  #端口  
  40.         server_name  localhost; #ip或域名,可以多个www.abc.com,127.0.0.1  
  41.   
  42.         #charset koi8-r;   #编码格式  
  43.   
  44.         #access_log  logs/host.access.log  main;   #虚拟主机访问日志存放路径  
  45.   
  46.         location / {  
  47.             root   html;  
  48.             index  index.html index.htm;  
  49.         }  
  50.   
  51.         #error_page  404              /404.html;  
  52.   
  53.         # redirect server error pages to the static page /50x.html  
  54.         #  
  55.         error_page   500 502 503 504  /50x.html;  
  56.         location = /50x.html {  
  57.             root   html;  
  58.         }  
  59.   
  60.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80  
  61.         #  
  62.         #location ~ \.php$ {  
  63.         #    proxy_pass   http://127.0.0.1;  
  64.         #}  
  65.   
  66.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000  
  67.         #  
  68.         #location ~ \.php$ {  
  69.         #    root           html;  
  70.         #    fastcgi_pass   127.0.0.1:9000;  
  71.         #    fastcgi_index  index.php;  
  72.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  
  73.         #    include        fastcgi_params;  
  74.         #}  
  75.   
  76.         # deny access to .htaccess files, if Apache's document root  
  77.         # concurs with nginx's one  
  78.         #  
  79.         #location ~ /\.ht {  
  80.         #    deny  all;  
  81.         #}  
  82.     }  
  83.   
  84.   
  85.     # another virtual host using mix of IP-, name-, and port-based configuration  
  86.     #  
  87.     #server {  
  88.     #    listen       8000;  
  89.     #    listen       somename:8080;  
  90.     #    server_name  somename  alias  another.alias;  
  91.   
  92.     #    location / {  
  93.     #        root   html;  
  94.     #        index  index.html index.htm;  
  95.     #    }  
  96.     #}  
  97.   
  98.   
  99.     # HTTPS server  
  100.     #  
  101.     #server {  
  102.     #    listen       443;  
  103.     #    server_name  localhost;  
  104.   
  105.     #    ssl                  on;  
  106.     #    ssl_certificate      cert.pem;  
  107.     #    ssl_certificate_key  cert.key;  
  108.   
  109.     #    ssl_session_timeout  5m;  
  110.   
  111.     #    ssl_protocols  SSLv2 SSLv3 TLSv1;  
  112.     #    ssl_ciphers  HIGH:!aNULL:!MD5;  
  113.     #    ssl_prefer_server_ciphers   on;  
  114.   
  115.     #    location / {  
  116.     #        root   html;  
  117.     #        index  index.html index.htm;  
  118.     #    }  
  119.     #}  
  120.   

0 0
原创粉丝点击