[GH-ISSUE #2573] Can't show the Client real ip #1793

Closed
opened 2026-02-26 07:32:29 +03:00 by kerem · 5 comments
Owner

Originally created by @g-marinov on GitHub (Jan 31, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2573

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
No matter what I did can't see the client real IP, I can see only the docker IP.

LOGS:
web-address is the webpage I'm accessing

[31/Jan/2023:08:51:36 +0000] - 200 200 - GET http web-address "/openapi.json" [Client 192.168.208.1] [Length 1384] [Gzip -] [Sent-to 192.168.2.140] "Mozilla/5.0 (Linux; Android 12; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36" "http://web-address/docs"
[31/Jan/2023:08:51:39 +0000] - 200 200 - GET http web-address "/X-Real-IP" [Client 192.168.208.1] [Length 27] [Gzip -] [Sent-to 192.168.2.140] "Mozilla/5.0 (Linux; Android 12; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36" "http://web-address/docs"
[31/Jan/2023:08:51:46 +0000] - 200 200 - GET http web-address "/X-Forwarded-For" [Client 192.168.208.1] [Length 27] [Gzip -] [Sent-to 192.168.2.140] "Mozilla/5.0 (Linux; Android 12; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36" "http://web-address/docs"

Nginx Proxy Manager Version
jc21/nginx-proxy-manager:latest

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '443:443'
      - '81:81'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

Operating System
Docker Desktop

Additional context
FastApi

from typing import Union
from fastapi import FastAPI, Header, Request

app = FastAPI()

@app.get("/X-Forwarded-For")
async def root(request: Request):
    my_header = request.headers.get('X-Forwarded-For')
    return {"message": my_header}

@app.get("/X-Real-IP")
async def root(request: Request):
    my_header = request.headers.get('X-Real-IP')
    return {"message": my_header}
Originally created by @g-marinov on GitHub (Jan 31, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2573 - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** No matter what I did can't see the client real IP, I can see only the docker IP. LOGS: _**web-address** is the webpage I'm accessing_ ``` [31/Jan/2023:08:51:36 +0000] - 200 200 - GET http web-address "/openapi.json" [Client 192.168.208.1] [Length 1384] [Gzip -] [Sent-to 192.168.2.140] "Mozilla/5.0 (Linux; Android 12; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36" "http://web-address/docs" [31/Jan/2023:08:51:39 +0000] - 200 200 - GET http web-address "/X-Real-IP" [Client 192.168.208.1] [Length 27] [Gzip -] [Sent-to 192.168.2.140] "Mozilla/5.0 (Linux; Android 12; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36" "http://web-address/docs" [31/Jan/2023:08:51:46 +0000] - 200 200 - GET http web-address "/X-Forwarded-For" [Client 192.168.208.1] [Length 27] [Gzip -] [Sent-to 192.168.2.140] "Mozilla/5.0 (Linux; Android 12; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36" "http://web-address/docs" ``` **Nginx Proxy Manager Version** jc21/nginx-proxy-manager:latest ``` version: '3' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' - '443:443' - '81:81' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt ``` **Operating System** Docker Desktop **Additional context** FastApi ``` from typing import Union from fastapi import FastAPI, Header, Request app = FastAPI() @app.get("/X-Forwarded-For") async def root(request: Request): my_header = request.headers.get('X-Forwarded-For') return {"message": my_header} @app.get("/X-Real-IP") async def root(request: Request): my_header = request.headers.get('X-Real-IP') return {"message": my_header} ```
kerem 2026-02-26 07:32:29 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@navhawk80 commented on GitHub (Jan 31, 2023):

Please del

<!-- gh-comment-id:1410966699 --> @navhawk80 commented on GitHub (Jan 31, 2023): Please del
Author
Owner

@g-marinov commented on GitHub (Feb 2, 2023):

Hi navhawk80, this doesn't fix the problem.
After a few hours of tests, I finally find the problem. The problem is the Windows 🥇, it's not only nginx, traefik has the same issue ... When I switch to my ubuntu server everything was working well.

<!-- gh-comment-id:1413855558 --> @g-marinov commented on GitHub (Feb 2, 2023): Hi navhawk80, this doesn't fix the problem. After a few hours of tests, I finally find the problem. The problem is the Windows 🥇, it's not only nginx, traefik has the same issue ... When I switch to my ubuntu server everything was working well.
Author
Owner

@navhawk80 commented on GitHub (Feb 2, 2023):

Hi,
Please disregard info I mentioned above.
Real fix was the script from here https://gist.github.com/pedrolamas/db809a2b9112166da4a2dbf8e3a72ae9
I put it into startup on my synology and now in LOGs external IPs are beaing reconnized correctly.

<!-- gh-comment-id:1414172169 --> @navhawk80 commented on GitHub (Feb 2, 2023): Hi, Please disregard info I mentioned above. Real fix was the script from here https://gist.github.com/pedrolamas/db809a2b9112166da4a2dbf8e3a72ae9 I put it into startup on my synology and now in LOGs external IPs are beaing reconnized correctly.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 29, 2024):

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

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

@github-actions[bot] commented on GitHub (Mar 15, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2726120261 --> @github-actions[bot] commented on GitHub (Mar 15, 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#1793
No description provided.