[GH-ISSUE #1885] Not getting user's correct IP (getting NPM docker container's local ip) #1376

Closed
opened 2026-02-26 07:30:44 +03:00 by kerem · 2 comments
Owner

Originally created by @Aniket-IN on GitHub (Feb 23, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1885

Hi guys,
I'm very new to the self-hosting world, not have much experience in Nginx or Apache.

I'm running a few services like Laravel, PhpMyAdmin, NextCloud.
All of these services running on Apache.

Now the problem is Laravel and PhpMyAdmin not getting correct user ip (getting NPM docker container's local ip).
image

Altho I've checked my Laravel application is getting correct headers like x-forwarded-for and x-real-ip

image

But after googling for an hour, I noticed NextCloud is getting the correct user IP.
When I looked at NextCloud's GitHub page, there they mentioned.
image

I also tried to do the same with my laravel application (adding ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16'] to $proxies)
**laravel provides a TrustProxies.php middleware

And it worked !!!

But now I have to configure PhpMyAdmin and all services like this.

I was wondering if there's a way to achieve the same from our Nginx Proxy server's end.
So that we don't have to do that on every container.

Thank you so much in advance :)

And also Thank you for this package, it's truly amazing..

Originally created by @Aniket-IN on GitHub (Feb 23, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1885 Hi guys, I'm very new to the self-hosting world, not have much experience in `Nginx` or `Apache`. I'm running a few services like `Laravel`, `PhpMyAdmin`, `NextCloud`. All of these services running on `Apache`. Now the problem is Laravel and PhpMyAdmin not getting correct user ip (getting NPM docker container's local ip). ![image](https://user-images.githubusercontent.com/64463116/155400742-83970e4f-2828-4e43-90e6-1d305a343e23.png) Altho I've checked my Laravel application is getting correct headers like `x-forwarded-for` and `x-real-ip` ![image](https://user-images.githubusercontent.com/64463116/155400221-eff0d34c-0a6d-4133-971f-63d8728425a8.png) But after googling for an hour, I noticed `NextCloud` is getting the correct user IP. When I looked at NextCloud's GitHub page, there they mentioned. ![image](https://user-images.githubusercontent.com/64463116/155401147-d571fa33-3f0c-43c5-9603-5edf3063e610.png) I also tried to do the same with my laravel application (adding `['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']` to `$proxies`) **laravel provides a `TrustProxies.php` middleware And it worked !!! But now I have to configure PhpMyAdmin and all services like this. I was wondering if there's a way to achieve the same from our Nginx Proxy server's end. So that we don't have to do that on every container. Thank you so much in advance :) And also Thank you for this package, it's truly amazing..
kerem 2026-02-26 07:30:44 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@github-actions[bot] commented on GitHub (Feb 23, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1960626178 --> @github-actions[bot] commented on GitHub (Feb 23, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Apr 8, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2785047593 --> @github-actions[bot] commented on GitHub (Apr 8, 2025): Issue was closed due to inactivity.
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/nginx-proxy-manager-NginxProxyManager#1376
No description provided.