nginx: centralize configuration
This commit is contained in:
parent
74bc853aae
commit
e3440b61ab
7 changed files with 22 additions and 35 deletions
21
services/nginx.nix
Normal file
21
services/nginx.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Part of config shamelessly stolen from:
|
||||
#
|
||||
# https://github.com/delroth/infra.delroth.net
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
# Whenever something defines an nginx vhost, ensure that nginx defaults are
|
||||
# properly set.
|
||||
config = lib.mkIf ((builtins.attrNames config.services.nginx.virtualHosts) != [ ]) {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
statusPage = true; # For monitoring scraping.
|
||||
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue