nginx
worker_processes 1;
events {
worker_connections 1024;
}
http {
# 这个文件中指定了文件后缀与返回的类型(Content-Type)对应关系,关系到浏览器处理对应后缀文件的方式
include mime.types;
# 默认类型是数据流的方式
default_type application/octet-stream;
# 是否开启零拷贝
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
# 这里以绝对路径开头,一般指的是编译时的prefix目录,可以在启动的时候更改这个目录
root html;
index index.html index.htm;
}
# 当发生对应错误码时,跳转到/50x.html的location
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}