语 法:http { ... }
默认值:—
上下文:main
提供指定 HTTP 服务器指令的配置文件上下文。例如:
# 配置工作进程数量
worker_processes 1;
events {
# 设置工作进程可以同时打开的最大连接数
worker_connections 1024;
}
http {
# 引用 MIME 类型
include mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
}
}