diff options
author | makefu <github@syntax-fehler.de> | 2016-12-24 15:39:37 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2016-12-24 15:39:37 +0100 |
commit | 78c50fe49599b5c3dd147ebd23253fa2abe53998 (patch) | |
tree | 6d609ffc1c59ed6bdb35ef354c5b96de7858e778 /tv/2configs/nginx | |
parent | d385e3c6968d9317b7d8adea3671c79258a24cec (diff) | |
parent | bece7d9da29adde2c79e49c40d975dc46eed4c1e (diff) |
Merge remote-tracking branch 'tv/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 | 16 |
2 files changed, 28 insertions, 11 deletions
diff --git a/tv/2configs/nginx/default.nix b/tv/2configs/nginx/default.nix index 39995c052..b0acb9435 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 e0bbb8d57..9744da1e8 100644 --- a/tv/2configs/nginx/public_html.nix +++ b/tv/2configs/nginx/public_html.nix @@ -3,13 +3,19 @@ with import <stockholm/lib>; { - krebs.nginx = { + services.nginx = { enable = true; - servers.default.locations = [ - (nameValuePair "~ ^/~(.+?)(/.*)?\$" '' + virtualHosts.default = { + serverAliases = [ + "localhost" + "${config.krebs.build.host.name}" + "${config.krebs.build.host.name}.r" + "${config.krebs.build.host.name}.retiolum" + ]; + locations."~ ^/~(.+?)(/.*)?\$".extraConfig = '' alias /home/$1/public_html$2; - '') - ]; + ''; + }; }; tv.iptables.input-internet-accept-tcp = singleton "http"; } |