Commit Graph

6 Commits (c1dc52ac291d98c8f36979eb507eb873baa5a20d)

Author SHA1 Message Date
Dustin 388fd91096 r/nginx: Configure error/access syslog separately
There may be cases where we want either error logs or access logs to be
sent to syslog, but not both.  To support these, there are now two
variables: `nginx_access_log_syslog` and `nginx_error_log_syslog`.
Both use the value of the `nginx_log_syslog` variable by default, so
existing users of the _nginx_ role will continue to work as before.
2024-10-20 12:10:17 -05:00
Dustin 845911dcbd r/nginx: Make logging to files optional
If _nginx_ is configured to send error/access log messages to syslog, it
may not make sense to _also_ send messages to log files as well.  The
`nginx_error_log_file` and `nginx_access_log_file` variables are now
available to control whether/where to send log messages.  Setting either
of these to a falsy value will disable logging to a file.  A non-empty
string value is interpreted as the path to a log file.  By default, the
existing behavior of logging to `/var/log/nginx/error.log` and
`/var/log/nginx/access.log` is preserved.
2024-10-14 12:00:19 -05:00
Dustin 219fe75424 r/nginx: logrotate: do not delay compressing
_nginx_ access logs are typically either very small or very large.  For
small log files, it's fast enough to decompress them on the fly if
necessary.  For large files, they may take up so much space in
uncompressed form that the log volume fills too quickly.  In either
case, compressing the files as soon as they are rotated is a good
option, especially since their contents should already be sent to Loki.
2024-09-30 12:43:25 -05:00
Dustin 829c04332d r/nginx: Configure logrotate
The default `logrotate` configuration for _nginx_ may not be appropriate
for high-volume servers.  The `nginx_keep_num_logs` variable is now
available to control how many days of logs are kept.
2024-09-29 11:20:29 -05:00
Dustin 7e08fb66f7 r/nginx: Fix applying on Buildroot systems
There are a few minor differences between the way Fedora and Buildroot
package *nginx*:

* Fedora uses a user named *nginx* while buildroot uses *www-data*
* Buildroot uses a Debian-like configuration layout (with
  `sites-enabled` and `modules-enabled` directories)

This commit adjusts the *nginx* Ansible role to compensate for these
differences, eschewing Buildroot's configuration layout for the one used
by Fedora/Red Hat.
2022-08-10 21:55:54 -05:00
Dustin 5de8f3e612 roles/nginx: Add role for nginx
This role installs nginx and provides a base/skeleton configuration
suitable for most deployments.
2021-06-29 21:00:46 -05:00