# 全局块
#user nobody;
worker_processes 1;
# event块
events {
worker_connections 1024;
}
# http块
http {
# http全局块
include mime.types; # 加载 MIME 标准文件
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# server块, 一个块监听一个端口
server {
# server全局块
listen 8000; # 指定监听端口
server_name localhost; # 指定监听地址
# location块
location / { # 指定监听路由
root html; # 指定 root 文件夹
index index.html index.htm; # 指定启动文件
}
error_page 500 502 503 504 /50x.html; # 指定错误页面
location = /50x.html {
root html;
}
}
# 这边可以有多个server块
server {
...
}
}