summaryrefslogtreecommitdiff
path: root/modules/xnet/nginx.nix
blob: 64c1d65d0a9e98b5b1e1c36ac19bbcdfe6cb5752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ config, lib, ... }:
let
  cfg = config.xnet.nginx;

  inherit (lib) mkOption mkIf types;
in
{

  options.xnet.nginx = {
    enable = mkOption {
      type = types.bool;
      default = false;
      description = "Enable optimized nginx.";
    };
  };

  config = mkIf cfg.enable {
    networking.firewall.allowedTCPPorts = [ 80 443 ];

    services.nginx = {
      enable = true;
      recommendedGzipSettings = true;
      recommendedOptimisation = true;
      recommendedProxySettings = true;
      recommendedTlsSettings = true;
    };
  };
}