Mitigate risk of disk space issues somewhat #92
					 1 changed files with 15 additions and 10 deletions
				
			
		|  | @ -153,16 +153,21 @@ | |||
|   services.logrotate = { | ||||
|     enable = true; | ||||
| 
 | ||||
|     settings = lib.mapAttrs' (virtualHost: _: | ||||
|       lib.nameValuePair "/var/log/nginx/${virtualHost}/access.log" { | ||||
|         frequency = "daily"; | ||||
|         rotate = 2; | ||||
|         compress = true; | ||||
|         delaycompress = true; | ||||
|         su = "${config.services.nginx.user} ${config.services.nginx.group}"; | ||||
|         postrotate = "[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`"; | ||||
|       }) | ||||
|     config.services.nginx.virtualHosts; | ||||
|     settings = | ||||
|       { | ||||
|         # Override the default, just keep fewer logs | ||||
|         nginx.rotate = 6; | ||||
|       } | ||||
|       // lib.mapAttrs' (virtualHost: _: | ||||
|         lib.nameValuePair "/var/log/nginx/${virtualHost}/access.log" { | ||||
|           frequency = "daily"; | ||||
|           rotate = 2; | ||||
|           compress = true; | ||||
|           delaycompress = true; | ||||
|           su = "${config.services.nginx.user} ${config.services.nginx.group}"; | ||||
|           postrotate = "[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`"; | ||||
|         }) | ||||
|       config.services.nginx.virtualHosts; | ||||
|   }; | ||||
|   systemd.tmpfiles.rules = | ||||
|     lib.mapAttrsToList ( | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue