Nginx配置文件中文注释详解
Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。
Nginx配置文件详解
#运行用户 user nobody nobody; #启动进程 worker_processes 2; #全局错误日志及PID文件 error_log logs/error.log notice; pid logs/nginx.pid; #工作模式及连接数上限 events { use epoll; worker_connections 1024; } #设定http服务器,利用它的反向代理功能提供负载均衡支持 http { #设定mime类型 include conf/mime.types; default_type application/octet-stream; #设定日志格式 log_format main ‘$remote_addr – $remote_user [$time_local] ‘ ‘”$request” $status $bytes_sent ‘ ‘”$http_referer” “$http_user_agent” ‘ ‘”$gzip_ratio”‘; log_format download ‘$remote_addr – $remote_user [$time_local] ‘ ‘”$request” $status $bytes_sent ‘ ‘”$http_referer” “$http_user_agent” ‘ ‘”$http_range” “$sent_http_content_range”‘; #设定请求缓冲 client_header_buffer_size 1k; large_client_header_buffers 4 4k; #开启gzip模块 #设定虚拟主机 #对 “/” 启用负载均衡 #设定查看Nginx状态的地址 |
备注:conf/htpasswd 文件的内容用 apache 提供的 htpasswd 工具来产生即可。
3.) 查看 Nginx 运行状态
输入地址 http://192.168.8.1/NginxStatus/,输入验证帐号密码,即可看到类似如下内容:
Active connections: 328 server accepts handled requests 9309 8982 28890 Reading: 1 Writing: 3 Waiting: 324 |
第一行表示目前活跃的连接数
第三行的第三个数字表示Nginx运行到当前时间接受到的总请求数,如果快达到了上限,就需要加大上限值。
第四行是Nginx的队列状态
最新文章
- [课程设计]Scrum 3.5 多鱼点餐系统开发进度(修复Bug&;美化页面)
- j-link或者swd调试
- MVP
- jquery消息提示框
- 【转载】Android通过ksoap2调用.net(c#)的webservice
- CSS3几个速记标签2
- c++之 数组
- Java操作XML文件 dom4j 篇
- JAVA GUI学习 - 窗口【x】按钮关闭事件触发器:重写processWindowEvent(WindowEvent e)方法
- GUI线程 :打字母游戏
- [Python] 文科生零基础学编程系列二——数据类型、变量、常量的基础概念
- Apollo阿波罗配置中心docker
- LINUX系统日常使用命令
- 设计模式学习心得<;组合模式 Composite>;
- Chrome扩展插件流程
- Reflection 反射
- .Net Core项目在Docker上运行,内存占用过多导致pods重启的问题
- navicat-mysql-linux工具
- XML文档的读、写
- Mysql优化与使用集锦