From 2ad5c53abd33efc4e5a14ce0f77f9ad16a8368a0 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Wed, 3 Jan 2024 03:05:47 +0100 Subject: [PATCH] nextcloud: fix reverse proxy --- hosts/defiant/services/nginx.nix | 3 +++ hosts/voyager/services/nextcloud.nix | 1 + 2 files changed, 4 insertions(+) diff --git a/hosts/defiant/services/nginx.nix b/hosts/defiant/services/nginx.nix index 1934c04..7ecf990 100644 --- a/hosts/defiant/services/nginx.nix +++ b/hosts/defiant/services/nginx.nix @@ -55,6 +55,9 @@ forceSSL = true; extraConfig = '' + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + server_tokens off; gzip on; gzip_vary on; diff --git a/hosts/voyager/services/nextcloud.nix b/hosts/voyager/services/nextcloud.nix index f682ad7..5ac8de4 100644 --- a/hosts/voyager/services/nextcloud.nix +++ b/hosts/voyager/services/nextcloud.nix @@ -44,6 +44,7 @@ in { dbname = "nextcloud"; adminpassFile = "/srv/secrets/adminpass"; adminuser = "ncadmin"; + trustedProxies = [ "192.168.10.175" ]; # defiant }; # phpOptions = {