Doesn’t that prevent accesses resolved directly by nginx from being logged? Is there any reason why it should be there? In other words… Can I move those lines higher up, in the server block, before the error codes, without collateral damage or side effects?
This is a question from an inexperienced user, so thank you for your patience
Keep in mind that in an Nginx + Apache2 configuration, Nginx acts as a proxy, so it only logs the files it serves directly (such as proxy_extensions). All other access logs are handled by Apache2.
Note: Keep in mind that, regardless of which service manages the access log, both Nginx and Apache2 write to the same log file: /var/log/apache2/domains/YourDomain.log.
Is CustomLog necessary? So, I understand that moving access_log could affect some Hestia functions? Or do you assume those lines should be commented?
I’ve tried moving them to the server block. Accesses from both servers seem to be logging correctly in the same file. You know how it is: that primate instinct to try things without knowing what you’re doing…
This would solve two things for me:
Obtain a log of all accesses, including those cached by nginx, to have complete statistical data with tools that read logs (goaccess, matomo…).
Log accesses with error code 444, originating from the rate limit configuration. I can then easily use that with fail2ban.