infra/roles/nginx.nix

34 lines
809 B
Nix
Raw Normal View History

2021-03-04 11:02:47 +01:00
{ config, lib, pkgs, ... }:
{
2021-03-04 11:05:17 +01:00
networking.firewall.allowedTCPPorts = [ 443 80 ];
2021-03-04 11:02:47 +01:00
# nginx is being used as the frontend HTTP server for all the services
# running on the box
2021-03-04 11:05:17 +01:00
services.nginx = {
enable = true;
2021-03-04 11:02:47 +01:00
2021-03-04 11:05:17 +01:00
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# Should we have this?
#commonHttpConfig = ''
# add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload' always;
#'';
resolver.addresses =
if config.networking.nameservers == [ ]
then [ "1.1.1.1" ]
else config.networking.nameservers;
sslDhparam = config.security.dhparams.params.nginx.path;
};
security.dhparams = {
enable = true;
params.nginx = { };
};
2021-03-04 11:02:47 +01:00
}