#859·dockge

Need a way to set the `trustProxy` setting for reverse proxies

Author: rob4226Created Sep 27, 2025Updated Jul 18, 2026
Labelsbug

⚠️ Please verify that this bug has NOT been reported before.

  • I checked and didn't find similar issue

️ Security Policy

Description

Unless I missed it somewhere, there doesn't seem to be a way to set the trustProxy setting. Per the below source code:

https://github.com/louislam/dockge/blob/e31f76651684cf3252471ee48051088175951cfe/backend/dockge-server.ts#L459-L469

if the trustProxy setting is not set, the X-Forwarded-For and X-Real-Ip headers will not be respected which is needed when a reverse proxy is used.

I set the trustProxy setting in the Sqlite3 database manually and the real IP's were used correctly so just a way to set the trustProxy setting with an environment variable and/or a setting in the web UI is needed.

sql
INSERT INTO setting (key,value,type) VALUES('trustProxy', 'true', 'general');

Reproduction steps

Use a reverse proxy and login into Dockage and the logs will report the private IP address of the Docker container instead of the real IP address of the user.

Expected behavior

A way to set the trustProxy setting with an environment variable and/or a setting in the web UI so that the X-Forwarded-For and X-Real-Ip headers will be respected when using a reverse proxy.

Actual Behavior

The private IP address 172.19.0.1 of the docker container is reported instead of the real IP:

dockge-1  | 2025-09-26T21:09:24Z [AUTH] INFO: Origin is not set, IP: ::ffff:172.19.0.1
dockge-1  | 2025-09-26T21:09:24Z [SERVER] INFO: Socket connected (direct)
dockge-1  | 2025-09-26T21:09:24Z [SERVER] INFO: Redirect to setup page
dockge-1  | 2025-09-26T21:10:15Z [AUTH] INFO: Login by username + password. IP=172.19.0.1
dockge-1  | 2025-09-26T21:10:15Z [RATE-LIMIT] INFO: remaining requests: 19
dockge-1  | 2025-09-26T21:10:15Z [AUTH] INFO: Successfully logged in user MyUsername99. IP=172.19.0.1

Dockge Version

1.5.0

Operating System and Arch

Ubuntu Server 25.04

Browser

Google Chrome 140.0.7339.208

Docker Version

Docker version 28.4.0, build d8eb465

NodeJS Version

No response

Relevant log output

bash
dockge-1  | 2025-09-26T21:09:24Z [AUTH] INFO: Origin is not set, IP: ::ffff:172.19.0.1
dockge-1  | 2025-09-26T21:09:24Z [SERVER] INFO: Socket connected (direct)
dockge-1  | 2025-09-26T21:09:24Z [SERVER] INFO: Redirect to setup page
dockge-1  | 2025-09-26T21:10:15Z [AUTH] INFO: Login by username + password. IP=172.19.0.1
dockge-1  | 2025-09-26T21:10:15Z [RATE-LIMIT] INFO: remaining requests: 19
dockge-1  | 2025-09-26T21:10:15Z [AUTH] INFO: Successfully logged in user MyUsername99. IP=172.19.0.1