diff options
author | lassulus <lass@lassul.us> | 2016-12-23 18:38:28 +0100 |
---|---|---|
committer | lassulus <lass@lassul.us> | 2016-12-23 18:38:28 +0100 |
commit | b8975f6ed4cde4af3e72f0f83624221ee6351885 (patch) | |
tree | 53f0207a1b3009999b42b19c6c919b7c95b0a02b /tv/2configs/nginx | |
parent | 1d2c9377bc7b21ff7d27c6c04873a46df083d655 (diff) | |
parent | c208b3fa19fc161f44c52433a4e266daade4ce53 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/2configs/nginx')
-rw-r--r-- | tv/2configs/nginx/default.nix | 23 | ||||
-rw-r--r-- | tv/2configs/nginx/public_html.nix | 14 |
2 files changed, 23 insertions, 14 deletions
diff --git a/tv/2configs/nginx/default.nix b/tv/2configs/nginx/default.nix index 39995c05..b0acb943 100644 --- a/tv/2configs/nginx/default.nix +++ b/tv/2configs/nginx/default.nix @@ -3,15 +3,26 @@ with import <stockholm/lib>; { - krebs.nginx = { - servers.default.locations = [ - (nameValuePair "= /etc/os-release" '' + services.nginx = { + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedTlsSettings = true; + + virtualHosts._http = { + default = true; + extraConfig = '' + return 404; + ''; + }; + + virtualHosts.default = { + locations."= /etc/os-release".extraConfig = '' default_type text/plain; alias /etc/os-release; - '') - ]; + ''; + }; }; - tv.iptables = optionalAttrs config.krebs.nginx.enable { + tv.iptables = { input-retiolum-accept-tcp = singleton "http"; }; } diff --git a/tv/2configs/nginx/public_html.nix b/tv/2configs/nginx/public_html.nix index 4c74d225..9744da1e 100644 --- a/tv/2configs/nginx/public_html.nix +++ b/tv/2configs/nginx/public_html.nix @@ -3,20 +3,18 @@ with import <stockholm/lib>; { - krebs.nginx = { + services.nginx = { enable = true; - servers.default = { - server-names = [ + virtualHosts.default = { + serverAliases = [ "localhost" "${config.krebs.build.host.name}" "${config.krebs.build.host.name}.r" "${config.krebs.build.host.name}.retiolum" ]; - locations = [ - (nameValuePair "~ ^/~(.+?)(/.*)?\$" '' - alias /home/$1/public_html$2; - '') - ]; + locations."~ ^/~(.+?)(/.*)?\$".extraConfig = '' + alias /home/$1/public_html$2; + ''; }; }; tv.iptables.input-internet-accept-tcp = singleton "http"; |