请问使用 Nginx Proxy Manager 如何配置才能获取访客真实IP ? #23

Closed
opened 2025-06-19 07:00:18 +08:00 by spysir · 3 comments
spysir commented 2025-06-19 07:00:18 +08:00 (Migrated from github.com)

请问大佬,本人使用 Nginx Proxy Manager 进行反向代理,如何配置才能获取到真实访客 IP ?

请问大佬,本人使用 Nginx Proxy Manager 进行反向代理,如何配置才能获取到真实访客 IP ?
shenyunet commented 2025-06-19 09:13:07 +08:00 (Migrated from github.com)

上一下你的nginx conf 我看看

上一下你的nginx conf 我看看
spysir commented 2025-06-22 22:18:40 +08:00 (Migrated from github.com)

如下图所示,其它保持默认设置

Image

如下图所示,其它保持默认设置 ![Image](https://github.com/user-attachments/assets/09a860ee-5d03-4c69-8a84-9f0a442cdb7d)
beck-8 commented 2025-07-20 10:58:32 +08:00 (Migrated from github.com)
        proxy_set_header Host $host;      # 设置 Host 头
        proxy_set_header X-Real-IP $remote_addr;  # 设置 X-Real-IP 头
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  # 保持 X-Forwarded-For 头
        proxy_set_header X-Forwarded-Proto $scheme;  # 设置协议
proxy_set_header Host $host; # 设置 Host 头 proxy_set_header X-Real-IP $remote_addr; # 设置 X-Real-IP 头 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 保持 X-Forwarded-For 头 proxy_set_header X-Forwarded-Proto $scheme; # 设置协议
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 3344/hubproxy#23