A website in nginx cannot write to error.log

A website in nginx is configured with error_log, but when there is a 500th error in the site, there is no error record in the error log file

server {

listen 80;
server_name www.example.com;
error_log logs/error_example.log error;
location / {
    proxy_pass http://127.0.0.1:8000;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
}

}

the error_example.log file is automatically generated after loading the conf file, and both the logs folder and the error_example.log file have 777 permissions.

Mar.19,2021
Menu