mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
chore(docs): update nginx log document
This commit is contained in:
parent
abc73bbf77
commit
7669e34b62
3 changed files with 0 additions and 96 deletions
|
@ -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`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue