[PR #474] [CLOSED] Correctly handle X-Forwarded-For and retrieve the real IP (#473) #782

Closed
opened 2026-02-04 18:50:21 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pelican-dev/panel/pull/474
Author: @ItzExotical
Created: 7/9/2024
Status: Closed

Base: mainHead: real-ip


📝 Commits (3)

📊 Changes

2 files changed (+26 additions, -1 deletions)

View changed files

app/Http/Middleware/ProxyHandler.php (+22 -0)
📝 bootstrap/app.php (+4 -1)

📄 Description

This will correctly show the user's IP if the web server is configured to do so properly and is behind a service such as Cloudflare. Tested with Caddy built with this module. Works on my instance, but would love further testing by someone. The same should be done for wings, but I am not good at Go so someone else gets that task.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pelican-dev/panel/pull/474 **Author:** [@ItzExotical](https://github.com/ItzExotical) **Created:** 7/9/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `real-ip` --- ### 📝 Commits (3) - [`22cc4dc`](https://github.com/pelican-dev/panel/commit/22cc4dc517ce91dcf5e8a4d75e76db6350cdcbc8) Add ProxyHandler middleware - [`f7a4f5e`](https://github.com/pelican-dev/panel/commit/f7a4f5ed31abb21b48de186f5345beecd65ba388) Register ProxyHandler middleware - [`ebf87c4`](https://github.com/pelican-dev/panel/commit/ebf87c4615afefe9b15c28ea895a03eafe70742f) Make pint happy ### 📊 Changes **2 files changed** (+26 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `app/Http/Middleware/ProxyHandler.php` (+22 -0) 📝 `bootstrap/app.php` (+4 -1) </details> ### 📄 Description This will correctly show the user's IP if the web server is configured to do so properly and is behind a service such as Cloudflare. Tested with Caddy built with [this](https://caddyserver.com/docs/modules/http.ip_sources.cloudflare) module. Works on my instance, but would love further testing by someone. The same should be done for wings, but I am not good at Go so someone else gets that task. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-04 18:50:21 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel#782