File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ Nginx版本:`1.11.5`
62
62
- [ 跨域问题] ( #跨域问题 )
63
63
- [ 跳转到带www的域上面] ( #跳转到带www的域上面 )
64
64
- [ 代理转发] ( #代理转发 )
65
+ - [ 监控状态信息] ( #监控状态信息 )
65
66
- [ 代理转发连接替换] ( #代理转发连接替换 )
66
67
- [ ssl配置] ( #ssl配置 )
67
68
- [ 强制将http重定向到https] ( #强制将http重定向到https )
@@ -1146,6 +1147,44 @@ server {
1146
1147
}
1147
1148
```
1148
1149
1150
+ ### 监控状态信息
1151
+
1152
+ 通过 ` nginx -V ` 来查看是否有 ` with-http_stub_status_module ` 该模块。
1153
+
1154
+ > ` nginx -V ` 这里 ` V ` 是大写的,如果是小写的 ` v ` 即 ` nginx -v ` ,则不会出现有哪些模块,只会出现 ` nginx ` 的版本
1155
+
1156
+ ``` nginx
1157
+ location /nginx_status {
1158
+ stub_status on;
1159
+ access_log off;
1160
+ }
1161
+ ```
1162
+
1163
+ 通过 http://127.0.0.1/nginx_status 访问出现下面结果。
1164
+
1165
+ ``` bash
1166
+ Active connections: 3
1167
+ server accepts handled requests
1168
+ 7 7 5
1169
+ Reading: 0 Writing: 1 Waiting: 2
1170
+ ```
1171
+
1172
+ 1 . 主动连接(第 1 行)
1173
+
1174
+ 当前与http建立的连接数,包括等待的客户端连接:3
1175
+
1176
+ 2 . 服务器接受处理的请求(第 2~ 3 行)
1177
+
1178
+ 接受的客户端连接总数目:7
1179
+ 处理的客户端连接总数目:7
1180
+ 客户端总的请求数目:5
1181
+
1182
+ 3 . 读取其它信(第 4 行)
1183
+
1184
+ 当前,nginx读请求连接
1185
+ 当前,nginx写响应返回给客户端
1186
+ 目前有多少空闲客户端请求连接
1187
+
1149
1188
### 代理转发连接替换
1150
1189
1151
1190
``` nginx
You can’t perform that action at this time.
0 commit comments