From 5766426567be2251ac57c1ef5e4f6a5092b4aabc Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 20 Aug 2022 21:50:48 +0200 Subject: tv nginx: close requests with bad Host header --- tv/2configs/nginx/default.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'tv/2configs/nginx/default.nix') diff --git a/tv/2configs/nginx/default.nix b/tv/2configs/nginx/default.nix index b0acb94..e68fc71 100644 --- a/tv/2configs/nginx/default.nix +++ b/tv/2configs/nginx/default.nix @@ -8,18 +8,13 @@ with import ; recommendedOptimisation = true; recommendedTlsSettings = true; - virtualHosts._http = { + virtualHosts.${toJSON ""} = { default = true; extraConfig = '' - return 404; - ''; - }; - - virtualHosts.default = { - locations."= /etc/os-release".extraConfig = '' - default_type text/plain; - alias /etc/os-release; + error_page 400 =444 /; + return 444; ''; + rejectSSL = true; }; }; tv.iptables = { -- cgit v1.2.3 From 12cc11be09bf0d37e138ce29eea4beab7b61d9e4 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 20 Aug 2022 22:32:00 +0200 Subject: tv nginx: enable reload --- tv/2configs/nginx/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tv/2configs/nginx/default.nix') diff --git a/tv/2configs/nginx/default.nix b/tv/2configs/nginx/default.nix index e68fc71..efea3a8 100644 --- a/tv/2configs/nginx/default.nix +++ b/tv/2configs/nginx/default.nix @@ -4,6 +4,8 @@ with import ; { services.nginx = { + enableReload = true; + recommendedGzipSettings = true; recommendedOptimisation = true; recommendedTlsSettings = true; -- cgit v1.2.3