When you turn on the nginx rewrite log with rewrite_log on;
, where does the system actually log that info? It doesn't seem to be in the documentation, and a decent search through google doesn't turn anything up.
I have also tried enabling and looking in both the access and error logs. No luck.
By default, the Nginx access log is located at /var/log/nginx/access. log and the error log is located at /var/log/nginx/error. log . Nginx logs file default path depends on the operating system and installation.
You can set up logrotate for nginx, in this way you can maintain logs for 30 days or more as per your requirements !
Configure NGINX access log By default, the access log is located at /var/log/nginx/access. log , and the information is written to the log in the predefined combined format. You can override the default settings and change the format of logged messages by editing the NGINX configuration file ( /etc/nginx/nginx.
The default log format in nginx is called "combined".
If rewrite_log on;
is used then the rewrite information will be logged to error_log
at notice
level. There is no separate log file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With