From 587015b9d7d3955d8e1c8d89ef95047078492f9a 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 b0acb9435..e68fc714f 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