rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: gogi1000 on July 10, 2022, 11:30:47 AM
-
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
-
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.
-
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?
-
it depends on the firewall, and i don't know your firewall
-
@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).
-
- the ip address does not shown in the apache server
- yes
- the windows
- the cisco
-
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 (https://community.cisco.com/t5/networking/ct-p/4461-network-infrastructure). 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. :)
-
so, you are using apache as reverse proxy in front of hfs ?
if yes, you are on case #3 of my list
-
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
-
if apache/nginx works as reverse-proxy, it forwards the client's ip to HFS
-
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.
-
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.