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


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
6 views
This:

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 | 6 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.
\r
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.
by
0 like 0 dislike
If nginx+apache2, enabled mod_rpaf?
\r
Debian included mod_rpaf:
\r# a2enmod rpaf
\r
If not installed, install
\r# aptitude install libapache2-mod-rpaf
\r
Then in /etc/apache2/httpd.conf add:
\r
\rRPAFenable On
RPAFsethostname Off
RPAFproxy_ips 127.0.0.1 Tutberidze

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

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
5 answers
asked Mar 27, 2019 by Screatch
0 like 0 dislike
3 answers
asked May 5, 2019 by bulat_giniyatov
110,608 questions
257,186 answers
0 comments
27,911 users