Answer the question
In order to leave comments, you need to log in
How to get the user's IP if the server is behind a router?
Given:
- Router on dd-wrt with full access.
- Server with nginx behind a router.
Forwarded the webserver port. I look at the nginx logs - $remote_addr is written there, and this parameter is equal to the IP of the router.
Is there any way to find out the real IP of the caller?
Answer the question
In order to leave comments, you need to log in
In my opinion, the comrade who unsubscribed above did not understand the essence.
the port is forwarded on the router with dd-wrt (iptables), that is, your web server will not receive a real address in any way, be it at least Apache, at least Engenks, at least something else.
So don't bother.
In your case, the output is this - only if possible, put a proxy on dd-wrt redirecting to your internal web server. But this is if your router allows.
If it's nginx+apache2, is mod_rpaf enabled?
Debian, enable mod_rpaf:
# a2enmod rpaf
If not installed, install:
# aptitude install libapache2-mod-rpaf
Then /etc/apache2/httpd.conf
add:
Restart Apache2:
or
RPAFenable On
RPAFsethostname Off
RPAFproxy_ips 127.0.0.1 тут_пишем_свой_ip
# /etc/init.d/apache2 restart
# apache2ctl restart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question