Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
19.1 Legacy Series
»
Nginx log rotate
« previous
next »
Print
Pages: [
1
]
Author
Topic: Nginx log rotate (Read 6876 times)
ccesario
Jr. Member
Posts: 83
Karma: 1
Nginx log rotate
«
on:
June 21, 2019, 06:23:29 pm »
Hi folks,
Could someone explain how is done the Nginx log rotate?
It seems that tls_handshake.log does not rotating, i my system I need delete it manually, it was 5Gb.
Best regards
Carlos
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx log rotate
«
Reply #1 on:
June 21, 2019, 09:57:28 pm »
https://github.com/opnsense/plugins/blob/master/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/newsyslog.conf
Logged
ccesario
Jr. Member
Posts: 83
Karma: 1
Re: Nginx log rotate
«
Reply #2 on:
June 24, 2019, 03:40:02 pm »
Hi Fabian, thanks by reply.
Well, this confirm my suspect. The tls_handshake.log log file does not have syslog rule for rotate it.
Is it possible add it?
Regards,
Carlos
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx log rotate
«
Reply #3 on:
June 24, 2019, 05:57:56 pm »
yes but this has some side effects - the reason why it is not rotated is because it builds the stats used for the fingerprint page from that file. If it is rolled over, the data will not be available anymore so the display feature may not work anymore for users who have not such a huge amount of traffic to get such a log on a daily basis.
I think the solution to get is rotating it less frequently like once per one or two weeke or so.
Logged
ccesario
Jr. Member
Posts: 83
Karma: 1
Re: Nginx log rotate
«
Reply #4 on:
June 24, 2019, 06:26:37 pm »
Ohhh I undesrtood.
But this file increase fast fast and cause storage problem... One day running in my env cause more than 2GB
Currently I clean it by cron
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx log rotate
«
Reply #5 on:
June 24, 2019, 07:13:36 pm »
If you don't use this feature, you can delete it every minute (thats's the log reopen interval which is required for bot banning).
For the feature it would be enough to store the aggregated tuples {user agent, TLS curves, TLS ciphers, count}.
So we can group them using a cron so the file is rotated for example every hour if that helps. This has the small disadvantage, that the data is not in real time anymore but I think this is OK since the feature needs some time for a good accuracy.
Logged
ccesario
Jr. Member
Posts: 83
Karma: 1
Re: Nginx log rotate
«
Reply #6 on:
June 25, 2019, 03:56:31 pm »
Hi Fabian, thank you by your feedback.
I have created a syslog entry to rotate each hour, and it seems this solve my issue
Best regards
Carlos
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx log rotate
«
Reply #7 on:
July 27, 2019, 08:42:27 pm »
patch is available:
https://github.com/opnsense/plugins/pull/1427
Logged
ccesario
Jr. Member
Posts: 83
Karma: 1
Re: Nginx log rotate
«
Reply #8 on:
August 15, 2019, 01:38:13 pm »
Hi Fabian,
Thanks for this. it is working as expeced for me.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
19.1 Legacy Series
»
Nginx log rotate