Browse Source

enable status and logging for nginx

main
Leonora Tindall 1 year ago
parent
commit
b12d6e3d1f
Signed by: nora GPG Key ID: 7A8B52EC67E09AAF
  1. 15
      hosts/felonyspork/configuration.nix

15
hosts/felonyspork/configuration.nix

@ -65,6 +65,7 @@
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
statusPage = true;
virtualHosts."home.nora.codes" = {
addSSL = true;
enableACME = true;
@ -106,6 +107,20 @@
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
# Export nginx stats
services.prometheus.exporters.nginx = {
enable = true;
port = 9003;
openFirewall = true;
};
# Have nginx log access and errors to systemd
services.nginx.commonHttpConfig = ''
log_format main '$connection ($pipe): $host "$request" from $remote_addr ref "$http_referer" ($request_length b, $request_time s) got $status ($bytes_sent b)';
access_log syslog:server=unix:/dev/log main;
error_log stderr;
'';
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave

Loading…
Cancel
Save