nginx配置文件详解

ningx1.2的配置文件 如下. 里面有注释

[Shell] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#下面这个是工作进程的数量  可以使用auto,但建议使用当前cpu的2倍,2核 的写4.
worker_processes  1;
#使用哪个用户进行运行.
user  nobody;
#到此为止,之前或是最后一个{}之后的代码称为全局块.类似php的全局变量  下面的events{}是event块. 一般是事件的配置
events {
#理解并发数就可以了
    worker_connections  1024;
}
#http块,主要是http协议相关的设置
http {
#include是载入的意思,include空格之后的文件一定是存在的. 可以打开 mime.types文件看一下.它是存在的
    include       mime.types;
#默认的类型. 还记得header("Content-type:application/octet-stream")吗?
    default_type  application/octet-stream;
#一种技术 . 理解加速读取文件
    sendfile        on;
#连接超时
    keepalive_timeout  65;
#客户端提交最大
        client_max_body_size 800M;
#注意下面是  http块中的server块..注意,注意,,,server是http中的一个子模块. server下文会提到
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }
#错误面
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
#下面这句比较重要,是载入当前目录 下的vhost下的所有的conf文件
include vhosts/*.conf;
}

server的时空门http://www.php20.com/forum.php?m ... 1&extra=#pid271
 
 
 
原文地址:https://www.cnblogs.com/ghjbk/p/6727565.html