Nginx on Windows (via NSSM) still writing logs to old files despite updated log paths

I’m running nginx 1.24.0 on a Windows server, and I created a service using NSSM.

The access.log and error.log files are getting too large, so I want to redirect logs to access2.log and error2.log instead.
However, logs are still being written to the original access.log and error.log files, not the new ones.

Here is my configuration:

http {
    .....
    access_log logs/access2.log;
    error_log logs/error2.log;
    ....
}

How can I fix this issue so that logs are written to access2.log and error2.log instead?

I tried stopping the service, updating the log file paths in the configuration, and then starting it again.

I also tried renaming the existing log files before restarting the service, but the logs are still being written to the original access.log and error.log files.

Read more here: Source link