[root@localhost conf]# cat nginx.conf | grep -v '#' | grep -v '^$'
worker_processes 1; #worker 进程的数量
events { #事件区块开始
worker_connections 1024; #每个worker进程支持的最大连接数
} #事件区块结束
http { #Http区块开始
include mime.types; #Nginx 支持的媒体类型库文件包含
default_type application/octet-stream; #默认的媒体类型
sendfile on; #开启高效传输模式
keepalive_timeout 65; #连接超时
server { #一个server 代表一个站点
listen 80; #提供服务的端口80
server_name localhost; #提供服务的域名主机名
location / { #程序根目录定位,如只需入域名或IP时,默认定位到‘/’下
root html; #nginx目录下的http文件夹,程序根目录
index index.html index.htm; #定义默认加载页页为index.html
} #localtion模块结束
error_page 500 502 503 504 /50x.html; #定义转到错误页
location = /50x.html {
root html;
}
}
}
NGINX 配置文件理解 之二
原创wx592bc92b285c7 博主文章分类:Linux 基础学习 ©著作权
©著作权归作者所有:来自51CTO博客作者wx592bc92b285c7的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:NGINX 编译安装方法 之一
下一篇:NGINX 虚拟主机使用 之三
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
构建Nginx服务器之二 配置文件精讲
本篇主要对Nginx的配置文件参数做一个刨析!
linux web 反向代理 nginx -
nginx配置文件还原 nginx配置文件修改
步骤一:vi nginx.conf配置文件,参考本博文的最下面总结,自行去设置 最后nginx.conf内容为 步骤二:每次修改了nginx.conf配置文件后,都要
nginx配置文件还原 运维 后端 epoll nginx