How to get user IP, if the server is behind a router?

0 like 0 dislike

Router on dd-wrt with full access.

Server nginx behind a router.

Forwarding the port of the web server. See logs nginx — there is written the $remote_addr variable, and this parameter is set to the IP of the router.

Is there any way to find out the real IP of the setting?
by | 8 views

2 Answers

0 like 0 dislike
In my opinion, the above unsubscribe friend does not understand the essence.
port forwarded on the router with dd-wrt (iptables), that is Your web-server does not receive the real address in any way, whether it is at least Apache, though, engenx, at least something.
So do not bother.
In Your case the output is — only if you have the opportunity to put on dd-wrt proxy forwarding to your internal web server. But if You have a router allows.
0 like 0 dislike
If nginx+apache2, enabled mod_rpaf?
Debian included mod_rpaf:
\r# a2enmod rpaf
If not installed, install
\r# aptitude install libapache2-mod-rpaf
Then in /etc/apache2/httpd.conf add:
\rRPAFenable On
RPAFsethostname Off
RPAFproxy_ips Tutberidze

Restarting Apache2:
\r# /etc/init.d/apache2 restart
\r# apache2ctl restart

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
5 answers
asked Mar 26, 2019 by Screatch
0 like 0 dislike
3 answers
asked May 4, 2019 by bulat_giniyatov
110,608 questions
257,186 answers
32,915 users