rejetto forum

problem with get ip address of external user in my log

gogi1000 · 12 · 11622

0 Members and 1 Guest are viewing this topic.

Offline gogi1000

  • Occasional poster
  • *
    • Posts: 44
    • View Profile
i have a the hfs server in the dmz zone. my hfs have a public ip address. when the user downloads file from the my hfs server in log it displays ip 127.0.0.1 how i can receive public ip address of  the user? the format of log is in the apache format %u %f "%r" %>s %b


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
HFS can display real address of the user in these cases
1) user directly connects to hfs (probably not an option for you)
2) you use NAT on your router. All configuration is to be done on your router, not on HFS
3) you use an http proxy (a generic proxy will hide the address). In this case if the proxy runs on the same computer you need no configuration on HFS. If it runs on another computer you have to configure manually as described at http://rejetto.com/forum/index.php?topic=6292.0

If you are using a generic proxy you have no way to receive external address.
If you are using FRP as proxy, it can be configured as http proxy and/or generic proxy.


Offline gogi1000

  • Occasional poster
  • *
    • Posts: 44
    • View Profile
My hfs server is behind the hardware firewall. the hfs server has the static public ip address? what i do? how configure firewall that my hfs receive the public ip of users?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile

Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 859
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
@gogi1000: May I ask you some questions?

1) Is the external IP address (of users who download files) shown if you use the Apache server?

2) Are you running Apache along with HFS? (are you running both servers at the same time?)

3) What operating system are you using?

4) What is the exact brand and model of your router? (or hardware firewall)

If you answer the following questions, it would be much easier to help you (and perhaps we could find more info on how to configure your system).
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline gogi1000

  • Occasional poster
  • *
    • Posts: 44
    • View Profile
  • the ip address does not shown in the apache server
  • yes
  • the windows
  • the cisco


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 859
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
If 'the IP address is not shown in the Apache server', then this issue could be related to your Cisco router, and HFS can't do anything to solve this. You could try to describe this problem (and ask for help), on the Cisco Community forum. Since HFS is not widely known, when describing your issue, my recommendation is only saying that you are using an 'Apache server'. I'm almost sure there must be some configuration on your router that is causing this. If you solve this, you could comment the solution here, as reference for other users, in case someone comes with a similar issue in the future. :)
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
so, you are using apache as reverse proxy in front of hfs ?
if yes, you are on case #3 of my list


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 911
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
i have a the hfs server in the dmz zone. my hfs have a public ip address. when the user downloads file from the my hfs server in log it displays ip 127.0.0.1 how i can receive public ip address of  the user? the format of log is in the apache format %u %f "%r" %>s %b

Sounds like you're using a patch she has reverse proxy. Because it's reverse proxy you'll always see the traffic coming on your local Host Network. Because that's what a proxy does. In that case you need to look into the logging on Apache when they first hit your Apache website that does the reverse proxy.

Otherwise you need a port forward your HFS to the public and use HFS as your main website.

See Apache docs:
https://httpd.apache.org/docs/2.4/mod/mod_proxy.html

Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
if apache/nginx works as reverse-proxy, it forwards the client's ip to HFS


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 911
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
1.hfs need to be set to receive an IP from any IP not set to local Host IP

2. Reverse proxy need to send traffic to the machine address not the localhost (this is why you are seeing 127.0.0.1)

Rejetto I have not found that to be the case, such as stunnel. The networking from stunnel is on the local Host and all connection are to and from the localhost. S tunnel logs the public ip. The work silent plz has done os to combine and see that log.

The same is still true with HFS in a reverse proxy situation as configuration by default. This is done to secure the connection with in the reverse proxy, that why jfs is seeing the connection as 127.0.0.1 as machine traffic forwarded it to that.

OP will need to revisit his Apache configuration to setup his networking to allow HFS to see that data.
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
1. it's described in the link i posted
2. i suppose this to not affect the mechanism, as it address is carried inside the http request

stunnel is not an http proxy, as apache can be, and so you have no way to get the real ip.

with nginx (i'm not using apache) you only need a line like this:
         proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;

as an alternative, HFS 3 is already supporting https natively, one may not need a proxy.
« Last Edit: August 12, 2022, 03:00:27 PM by rejetto »