Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I obtain the real ip address of the client #889

Open
waxi-i opened this issue Feb 10, 2025 · 2 comments
Open

How do I obtain the real ip address of the client #889

waxi-i opened this issue Feb 10, 2025 · 2 comments

Comments

@waxi-i
Copy link

waxi-i commented Feb 10, 2025

Operating system

CentOS 7.9

Description

How do I obtain the real ip address of the client

This is now done through the nginx reverse proxy, showing that the client ip is the ip address of the container

Docker compose

dms:
image: vdsm/virtual-dsm:7.20
container_name: dms
ports:
- "443:5001"
environment:
LANG: "en_US.utf8"
TZ: "Asia/Shanghai"
CPU_CORES: "8"
RAM_SIZE: "20G"
DISK_SIZE: "10G"
DISK2_SIZE: "300G"
URL: "DSM_VirtualDSM_72806.pat"
KVM: N
cap_add:
- NET_ADMIN
volumes:
- /disk/storage:/storage
- /disk1/storage1:/storage2
stop_grace_period: 2m
logging:
driver: json-file
options:
max-size: "100m"
max-file: "5"

Docker log

[ 77.382457] syno_extent_pool: module license 'Proprietary' taints kernel.
[ 77.382704] Disabling lock debugging due to kernel taint
[ 77.391833] iSCSI:extent_pool.c:766:ep_init syno_extent_pool successfully initialized
[ 77.436370] iSCSI:target_core_device.c:612:se_dev_align_max_sectors Rounding down aligned max_sectors from 4294967295 to 4294967288
[ 77.437690] iSCSI:target_core_configfs.c:5763:target_init_dbroot db_root: cannot open: /etc/target
[ 77.441227] iSCSI:target_core_lunbackup.c:366:init_io_buffer_head 2048 buffers allocated, total 8388608 bytes successfully
[ 77.542658] iSCSI:target_core_file.c:152:fd_attach_hba RODSP plugin for fileio is enabled.
[ 77.543462] iSCSI:target_core_file.c:159:fd_attach_hba ODX Token Manager is enabled.
[ 77.544395] iSCSI:target_core_multi_file.c:91:fd_attach_hba RODSP plugin for multifile is enabled.
[ 77.545261] iSCSI:target_core_ep.c:795:ep_attach_hba RODSP plugin for epio is enabled.
[ 77.545635] iSCSI:target_core_ep.c:802:ep_attach_hba ODX Token Manager is enabled.

❯ -----------------------------------------------------------
❯ You can now login to DSM at port 5000
❯ -----------------------------------------------------------

[ 78.175425] workqueue: max_active 1024 requested for vhost_scsi is out of range, clamping between 1 and 512
[ 82.754541] findhostd uses obsolete (PF_INET,SOCK_PACKET)
[ 90.182506] fuse init (API version 7.23)
[ 95.854497] Synotify use 16384 event queue size
[ 95.864997] Synotify use 16384 event queue size
[ 99.907471] Synotify use 16384 event queue size
[ 102.083053] Synotify use 16384 event queue size
[ 104.346052] Synotify use 16384 event queue size
[ 131.122608] Synotify use 16384 event queue size
[ 138.364269] Synotify use 16384 event queue size
[ 138.365203] Synotify use 16384 event queue size

Screenshots (optional)

Image
@kroese
Copy link
Collaborator

kroese commented Feb 10, 2025

Normally you add a line to nginx configuration like real_ip_header X-Forwarded-For, but this has nothing to do with this container.

@waxi-i
Copy link
Author

waxi-i commented Feb 13, 2025

I have done this configuration, please check whether this is normal, do you have a group chat or discussion group here? Like tg or whatever

client_max_body_size 10G;
location / {
    #proxy_pass http://dms:5000/;
    proxy_pass https://dms:5001/;
    proxy_set_header Host $http_host;
    #proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $http_host;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header X-Request-Id $request_id;

    proxy_http_version 1.1;
    proxy_ssl_verify off;
    proxy_ssl_session_reuse off;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants