Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

chore(backend:configuration): set trustProxy default to 1

johavene086c335ce38
diff --git a/backend/src/configuration/config.validation.ts b/backend/src/configuration/config.validation.ts
index edaa86cc..da6c2c4d 100644
--- a/backend/src/configuration/config.validation.ts
+++ b/backend/src/configuration/config.validation.ts
@@ -44,7 +44,7 @@ export class ServerConfig {
workers: number = 2
@IsOptional()
- trustProxy: boolean | string = false
+ trustProxy: boolean | string | number = 1
@IsBoolean()
restartOnFailure: boolean = true
diff --git a/docker/config/nginx/nginx.conf b/docker/config/nginx/nginx.conf
index 9dc9f919..4f0b7bcb 100644
--- a/docker/config/nginx/nginx.conf
+++ b/docker/config/nginx/nginx.conf
@@ -1,4 +1,4 @@
-# SYNC-IN NGINX TEMPLATE
+# SYNC-IN NGINX VHOST
map $request_uri $xfp {
# This header must be null on webdav uri
diff --git a/docker/environment.yaml b/docker/environment.yaml
index d751a1eb..e475d6be 100755
--- a/docker/environment.yaml
+++ b/docker/environment.yaml
@@ -1,6 +1,3 @@
-server:
- # prevent displaying Docker internal IP addresses
- trustProxy: true
mysql:
url: mysql://root:MySQLRootPassword@mariadb:3306/sync_in
auth:
diff --git a/environment/environment.dist.yaml b/environment/environment.dist.yaml
index 161409c2..64b145ae 100755
--- a/environment/environment.dist.yaml
+++ b/environment/environment.dist.yaml
@@ -6,8 +6,9 @@ server:
# workers: `auto` (use all cpus) | number
# regardless of the value, starts with at least 2 workers, 1 worker is dedicated to scheduled tasks
workers: 4
- # trust proxy: `true` | `false` | `127.0.0.1,192.168.1.1/24`
- trustProxy: false
+ # trust proxy: `true` | `false` | `127.0.0.1,192.168.1.1/24` | number (trust the nth hop from the front-facing proxy server as the client)
+ # default: 1
+ trustProxy: 1
# restartOnFailure: automatically restart workers if they are killed or die
# default: `true`
restartOnFailure: true