1
0
Fork 0
mirror of https://github.com/louislam/dockge.git synced 2026-03-03 02:06:55 -05:00

Need a way to set the trustProxy setting for reverse proxies #226

Open
opened 2026-02-20 13:12:23 -05:00 by deekerman · 0 comments
Owner

Originally created by @rob4226 on GitHub (Sep 26, 2025).

⚠️ 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:

github.com/louislam/dockge@e31f766516/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.

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

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
Originally created by @rob4226 on GitHub (Sep 26, 2025). ### ⚠️ Please verify that this bug has NOT been reported before. - [x] I checked and didn't find similar issue ### 🛡️ Security Policy - [x] I agree to have read this project [Security Policy](https://github.com/louislam/dockge/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 ```shell 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 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dockge-louislam#226
No description provided.