summaryrefslogtreecommitdiff
path: root/modules/xnet/nginx.nix
blob: 3e6ca7cf9e4ade86ad325faa66290348c8b4e38f (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
29
30
{ 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;
    };
  };
}