chore(docs): update nginx log document

This commit is contained in:
Jacky 2024-05-05 20:07:25 +08:00
parent abc73bbf77
commit 7669e34b62
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
3 changed files with 0 additions and 96 deletions

View file

@ -10,39 +10,6 @@
## 日志
Nginx 日志对于监控、排查问题和维护您的 Web 服务器至关重要。它们提供了有关服务器性能、用户行为和潜在问题的宝贵见解。
在本节中,我们将讨论两种主要类型的日志:访问日志和错误日志。
对于从 v1.5.2 或更早版本升级的 Nginx-UI Docker 用户,在配置 `app.ini` 之前,您需要在 `nginx.conf`
中添加单独的 `access_log``error_log` 指令。
在 Nginx-UI 容器中,`/var/log/nginx/access.log` 是一个指向 `/dev/stdout` 的符号链接,而 `/var/log/nginx/error.log`
是一个指向 `/dev/stderr` 的符号链接。这种设置允许您使用 `docker logs nginx-ui` 命令查看 Nginx 和 Nginx-UI 日志。然而,这两个设备不支持
`tail` 命令,因此有必要使用额外的日志文件来记录 Nginx 日志。
示例:
```nginx
error_log /var/log/nginx/error.log notice;
error_log /var/log/nginx/error.local.log notice;
http {
...
access_log /var/log/nginx/access.log main;
access_log /var/log/nginx/access.local.log main;
...
}
```
之后,请在 `app.ini` 中设置 nginx 访问日志和错误日志路径,然后重新启动 nginx-ui。
示例:
```ini
[nginx]
AccessLogPath = /var/log/nginx/access.local.log
ErrorLogPath = /var/log/nginx/error.local.log
```
### AccessLogPath
- 类型:`string`