From 953d2b5c5deaf10b83f2b9f7bbd18fbbadcb0fdc Mon Sep 17 00:00:00 2001 From: Joakim Repomaa Date: Fri, 7 Feb 2025 19:33:29 +0200 Subject: [PATCH] fix syncthing proxy fix syncthing proxy --- hosts/freun.dev/services/syncthing.nix | 10 +++------- modules/webserver.nix | 8 ++++++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hosts/freun.dev/services/syncthing.nix b/hosts/freun.dev/services/syncthing.nix index af7ecf9..8ad070e 100644 --- a/hosts/freun.dev/services/syncthing.nix +++ b/hosts/freun.dev/services/syncthing.nix @@ -10,15 +10,11 @@ in enable = true; dataDir = "/mnt/storage/syncthing"; openDefaultPorts = true; - guiAddress = "127.0.0.1:${toString port}"; + guiAddress = "[::1]:${toString port}"; + settings.gui.insecureSkipHostCheck = true; }; - modules.webserver.vHosts.${fqdn}.locations."/" = { - proxy = "http://127.0.0.1:${toString port}"; - extraConfig = '' - proxy_set_header Host $host; - ''; - }; + modules.webserver.vHosts.${fqdn}.locations."/".proxy = "http://localhost:${toString port}"; fileSystems."${storage_dir}" = { device = "//u407959.your-storagebox.de/backup/syncthing"; diff --git a/modules/webserver.nix b/modules/webserver.nix index 037b7ed..fff7afe 100644 --- a/modules/webserver.nix +++ b/modules/webserver.nix @@ -3,7 +3,6 @@ let cfg = config.modules.webserver; nginxVhost = options: { - http2 = true; forceSSL = true; enableACME = true; acmeRoot = lib.mkIf cfg.acme.dnsChallenge null; @@ -29,6 +28,10 @@ let vhost = lib.types.submodule { options = { + http2 = lib.mkOption { + type = lib.types.bool; + default = true; + }; proxyBuffering = lib.mkOption { type = lib.types.bool; default = true; @@ -71,7 +74,8 @@ in recommendedOptimisation = true; virtualHosts = lib.mapAttrs - (_: { proxyBuffering, locations }: nginxVhost { + (_: { proxyBuffering, locations, http2 }: nginxVhost { + inherit http2; extraConfig = lib.mkIf (!proxyBuffering) '' proxy_buffering off; '';