# nginxWebUI

## 4. nginx接口

### 4.1. 获取nginx状态

URL: /api/nginx/nginxStatus

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 获取nginx状态

Request-example:

    curl -X GET -i /api/nginx/nginxStatus

Response-fields:

Field | Type | Description | Since
--- | --- | --- | ---
success | boolean | 请求结果 | -
status | string | 请求状态 200:请求成功 401:token无效 500:服务器错误 | -
msg | string | 错误信息 | -
obj | object | 返回内容 | -

Response-example:

    {
      "success": true,
      "status": "",
      "msg": "",
      "obj": {}
    }

### 4.2. 替换conf文件

URL: /api/nginx/replace

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 替换conf文件

Request-example:

    curl -X GET -i /api/nginx/replace

Response-fields:

Field | Type | Description | Since
--- | --- | --- | ---
success | boolean | 请求结果 | -
status | string | 请求状态 200:请求成功 401:token无效 500:服务器错误 | -
msg | string | 错误信息 | -
obj | object | 返回内容 | -

Response-example:

    {
      "success": true,
      "status": "",
      "msg": "",
      "obj": {}
    }

### 4.3. 效验conf文件

URL: /api/nginx/check

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 效验conf文件

Request-example:

    curl -X GET -i /api/nginx/check

Response-fields:

Field | Type | Description | Since
--- | --- | --- | ---
success | boolean | 请求结果 | -
status | string | 请求状态 200:请求成功 401:token无效 500:服务器错误 | -
msg | string | 错误信息 | -
obj | object | 返回内容 | -

Response-example:

    {
      "success": true,
      "status": "",
      "msg": "",
      "obj": {}
    }

### 4.4. 重载conf文件

URL: /api/nginx/reload

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 重载conf文件

Request-example:

    curl -X GET -i /api/nginx/reload

Response-fields:

Field | Type | Description | Since
--- | --- | --- | ---
success | boolean | 请求结果 | -
status | string | 请求状态 200:请求成功 401:token无效 500:服务器错误 | -
msg | string | 错误信息 | -
obj | object | 返回内容 | -

Response-example:

    {
      "success": true,
      "status": "",
      "msg": "",
      "obj": {}
    }

### 4.5. 获取nginx启动命令

URL: /api/nginx/getNginxStartCmd

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 获取nginx启动命令

Request-example:

    curl -X GET -i /api/nginx/getNginxStartCmd

Response-fields:

Field | Type | Description | Since
--- | --- | --- | ---
success | boolean | 请求结果 | -
status | string | 请求状态 200:请求成功 401:token无效 500:服务器错误 | -
msg | string | 错误信息 | -
obj | array | 返回内容 | -

Response-example:

    {
      "success": true,
      "status": "",
      "msg": "",
      "obj": [
        "",
        ""
      ]
    }

### 4.6. 获取nginx停止命令

URL: /api/nginx/getNginxStopCmd

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 获取nginx停止命令

Request-example:

    curl -X GET -i /api/nginx/getNginxStopCmd

Response-fields:

Field | Type | Description | Since
--- | --- | --- | ---
success | boolean | 请求结果 | -
status | string | 请求状态 200:请求成功 401:token无效 500:服务器错误 | -
msg | string | 错误信息 | -
obj | array | 返回内容 | -

Response-example:

    {
      "success": true,
      "status": "",
      "msg": "",
      "obj": [
        "",
        ""
      ]
    }

### 4.7. 执行nginx命令

URL: /api/nginx/runNginxCmd

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=UTF-8

Description: 执行nginx命令

Query-parameters:

Parameter | Type | Description | Required | Since
--- | --- | --- | --- | ---
cmd | string | 命令内容 | false | -

Request-example:

    curl -X GET -i /api/nginx/runNginxCmd?cmd=

Response-fields:

Field | Type | Description | Since
--- | --- | --- | ---
success | boolean | 请求结果 | -
status | string | 请求状态 200:请求成功 401:token无效 500:服务器错误 | -
msg | string | 错误信息 | -
obj | object | 返回内容 | -

Response-example:

    {
      "success": true,
      "status": "",
      "msg": "",
      "obj": {}
    }