UserHostAddress gives wrong IPs

后端 未结 7 1582
[愿得一人]
[愿得一人] 2021-01-02 03:26

I collect statistics on IP addresses from where users visit my site and I have noticed what there are only two IP addresses presented, 172.16.16.1 and 172.16.16.248. The pro

7条回答
  •  再見小時候
    2021-01-02 04:00

    I assume you are behind a NAT/Reverse Proxy so I think you have to use:

    Request.ServerVariables("REMOTE_ADDR") 
    

    Most likely 172.16.0.0/12 is your privat LAN where 172.16.16.248 is your own address and 172.16.16.1 the address of your router/proxy.

提交回复
热议问题