mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
Created Nginx Log Configuration (markdown)
parent
25c592e5b1
commit
461d6bddce
1 changed files with 36 additions and 0 deletions
36
Nginx-Log-Configuration.md
Normal file
36
Nginx-Log-Configuration.md
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
Set nginx access log and error log path in `app.ini` then restart nginx-ui.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
[nginx_log]
|
||||||
|
AccessLogPath = /var/log/nginx/access.log
|
||||||
|
ErrorLogPath = /var/log/nginx/error.log
|
||||||
|
```
|
||||||
|
|
||||||
|
For nginx-ui **docker** users, if you upgrading from `v1.5.2` or lower version,
|
||||||
|
please add another `access_log` and `error_log` directive in your `nginx.conf` before setting the `app.ini`.
|
||||||
|
|
||||||
|
Because in nginx-ui container, `/var/log/nginx/access.log` is a symlink point to `/dev/stdout`, `/var/log/nginx/error.log` is a symlink point to `/dev/stderr`, so that you can view the nginx and nginx-ui log by using `docker logs nginx-ui`, but these two devices are not allow to tail, so we must
|
||||||
|
use another log file to record nginx logs.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
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;
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, set nginx access log and error log path in `app.ini` and restart nginx-ui.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
[nginx_log]
|
||||||
|
AccessLogPath = /var/log/nginx/access.local.log
|
||||||
|
ErrorLogPath = /var/log/nginx/error.local.log
|
||||||
|
```
|
Loading…
Add table
Add a link
Reference in a new issue