> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lwops.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 2.2.1. nginx配置

#### 2.2.1.1. windows系统

1、在nginx配置文件添加以下配置，启用ngx\_status 配置

```plain theme={null}
location /ngx_status
{
stub_status on;
access_log off;
}
```

![2.2.1. nginx配置 操作截图 1](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/nginx/image-01.png)

2、重新启动nginx服务

![2.2.1. nginx配置 操作截图 2](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/nginx/image-02.png)

3、测试状态页

![2.2.1. nginx配置 操作截图 3](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/nginx/image-03.png)

#### 2.2.1.2. linux系统

1、 启用nginx status配置，在默认主机里面加上location或者你希望能访问到的主机里面（绿色字体部分是需要添加的内容）

```plain theme={null}
# vim /usr/local/nginx/conf/nginx.conf
```

```plain theme={null}
server{
listen       80;
server_name  localhost;
index index.html index.htm index.php setup.php;

location /ngx_status
{
stub_status on;
access_log off;
}
}
```

2、重新启动nginx服务

```plain theme={null}
#service nginx restart
```

3、测试状态页

```plain theme={null}
#curl
Active connections: 1
server accepts handled requests
1 1 1
Reading: 0 Writing: 1 Waiting: 0
```

^
