Nextcloud getting 127.0.0.1 instead of real IP from NPM

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.6
  • Operating system and version (e.g., Ubuntu 24.04):
    • Truenas Scale ElectricEel-24.10.2
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • NPM 2.12.3
  • PHP version (e.g, 8.3):
    • 8.3.17
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • 3 weeks ago
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AlO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I have Pihole and NPM installed on another server, i configured nextcloud and pihole to use IPv6 if this is relevant
the Main problem is that I am facing in issue where the logged IP i am getting in Nextcloud is 127.0.0.1 instead of their real IP

Steps to replicate it (hint: details matter!):

  1. Install nextcloud AIO
  2. Put 1962.168.8.5 (IP address of pihole and NPM) in trusted Proxy
  3. Point drive.xxx.com to 192.168.8.4:11000 in NPM

Log entries

https://pastebin.com/MYu8t2aC

Web server / Reverse Proxy

(https://pastebin.com/2qxtRrEA)



Configuration

https://pastebin.com/xENfQEk8

Apps

https://pastebin.com/9ECdnC20

I am not sure but I attempted to restart both servers and now its working

For a container behind an reverse Proxy the http request contains a header that tells the client actual ip. I think its called x-forward something. Nginx should set this header normally. Maybe that change was made after restart.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.