I am running nginx 1.15.6 and I am trying to include the current date in the nginx log file name.
Some thing like this: access_log /var/log/nginx/access.2018.11.07.log main;
Anyone know how to do this?
I am running nginx 1.15.6 and I am trying to include the current date in the nginx log file name.
Some thing like this: access_log /var/log/nginx/access.2018.11.07.log main;
Anyone know how to do this?
This is what I ended up using and it works perfectly:
IF is Evil, in Nginx configurations. A detailed description as to why can be found at Nginx: If is Evil.
A better solution would be to use a map for logging dates.
Example below.