<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><font face="Times New Roman, Times, serif">What linux distro is
NginX running on?</font><br>
</p>
<div class="moz-signature">
<title>PEREGRINE IT Signature</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<p> <font size="4" face="Arial" color="842dce"><strong>Matthew J
BLACK</strong></font> <br>
<font size="2" face="Arial" color="b760ff"> M.Inf.Tech.(Data
Comms) <br>
MBA <br>
B.Sc. <br>
MACS (Snr), CP, IP3P </font> </p>
<p> <font size="3" face="Arial" color="842dce">When you want it
done <em>right</em> ‒ the first time!</font> </p>
<table border="0">
<tbody>
<tr>
<td align="right"><font size="1" face="Arial" color="b760ff">Phone:</font></td>
<td><font size="1" face="Arial" color="b760ff">+61 4 0411
0089</font></td>
</tr>
<tr>
<td align="right"><font size="1" face="Arial" color="b760ff">Email:</font></td>
<td><a href="mailto:matthew@peregrineit.net"><font size="1"
face="Arial" color="b760ff">matthew@peregrineit.net</font></a></td>
</tr>
<tr>
<td align="right"><font size="1" face="Arial" color="b760ff">Web:</font></td>
<td><a href="http://www.peregrineit.net"><font size="1"
face="Arial" color="b760ff">www.peregrineit.net</font></a></td>
</tr>
</tbody>
</table>
<p> <a href="http://au.linkedin.com/in/mjblack"> <img
src="http://s.c.lnkd.licdn.com/scds/common/u/img/webpromo/btn_viewmy_160x33.png"
alt="View Matthew J BLACK's profile on LinkedIn" width="160"
height="33" border="0"> </a> </p>
<font size="1" face="Arial">
<p> This Email is intended only for the addressee. Its use is
limited to that intended by the author at the time and it is
not to be distributed without the author’s consent. You must
not use or disclose the contents of this Email, or add the
sender’s Email address to any database, list or mailing list
unless you are expressly authorised to do so. Unless
otherwise stated, PEREGRINE I.T. Pty Ltd accepts no liability
for the contents of this Email except where subsequently
confirmed in writing. The opinions expressed in this Email
are those of the author and do not necessarily represent the
views of PEREGRINE I.T. Pty Ltd. This Email is confidential
and may be subject to a claim of legal privilege. </p>
<p> If you have received this Email in error, please notify the
author and delete this message immediately. </p>
</font>
</div>
<div class="moz-cite-prefix">On 30/06/2022 22:56, Mik J via nginx
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:918936775.577737.1656593795038@mail.yahoo.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="yahoo-style-wrap" style="font-family:Helvetica Neue,
Helvetica, Arial, sans-serif;font-size:16px;">
<div dir="ltr" data-setdir="false">Hello,</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">I have a real server placed
behing my reverse proxy</div>
<div dir="ltr" data-setdir="false">www server 192.168.1.10
<---> 192.168.1.20 reverse proxy <---> NAT
Firewall <---> Interrnet <---> Client on Internet</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">My configuration on my
reverse proxy (192.168.1.20) looks like that</div>
<div dir="ltr" data-setdir="false">
<div> location ^~ / {<br>
proxy_pass <a class="moz-txt-link-freetext" href="http://192.168.1.10:80">http://192.168.1.10:80</a>;<br>
proxy_redirect off;<br>
proxy_set_header Host
$http_host;<br>
proxy_set_header X-Real-IP
$remote_addr;<br>
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;<br>
proxy_set_header Referer
<a class="moz-txt-link-rfc2396E" href="http://app.mydomain.org">"http://app.mydomain.org"</a>;<br>
}<br>
<br>
</div>
<div><br>
</div>
<div dir="ltr" data-setdir="false">My configuration on my www
server (192.168.1.10) on the vhost looks like that</div>
<div dir="ltr" data-setdir="false">
<div>server {<br>
</div>
<div>...<br>
</div>
</div>
<div dir="ltr" data-setdir="false">
<div dir="ltr" data-setdir="false">
<div dir="ltr" data-setdir="false"> access_log
/var/log/nginx/mylogs.mydomain.org.access.log
xforwardedLog;</div>
<div> error_log /var/log/nginx/ <span>mylogs.mydomain.org</span>.error.log;</div>
<br>
</div>
<div dir="ltr" data-setdir="false">and in nginx.conf<br>
</div>
<div dir="ltr" data-setdir="false">
<div>http {<br>
...<br>
</div>
<div dir="ltr" data-setdir="false"><span>log_format
xforwardedLog '$remote_addr forwarded for
$http_x_real_ip - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';</span><br>
</div>
</div>
</div>
<div><br>
</div>
<div dir="ltr" data-setdir="false">On my www server
192.168.1.10 I can see the access logs</div>
<div dir="ltr" data-setdir="false"><span> <span>192.168.1.20</span> forwarded
for 54.38.10x.x - - [30/Jun/2022:13:44:38 +0200] "GET /
HTTP/1.0" 200 7112 "http://<span>app.mydomain.org</span>"
"Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0)
EudoraWeb 2.1"</span></div>
<div dir="ltr" data-setdir="false">And it works correctly for
me because I can see the IP of the user on the Internet</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">But on the error.log I
don't see the IP of the user on the Internet</div>
<div dir="ltr" data-setdir="false"><span>2022/06/28 16:12:27
[error] 45747#0: *11 access forbidden by rule, client:
192.168.1.20, server: app.mydomain.org, request: "GET
/.git/config HTTP/1.0", host: " <MY PUBLIC IP>",
referrer: <a class="moz-txt-link-rfc2396E" href="http://app.mydomain.org">"http://app.mydomain.org"</a></span></div>
<div dir="ltr" data-setdir="false">So here as you can see in
the logs my client 192.168.1.20 is the reverse proxy and not
the client on the Internet</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">So in access logs</div>
<div dir="ltr" data-setdir="false"><a
href="http://nginx.org/en/docs/http/ngx_http_log_module.html"
rel="nofollow" target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">http://nginx.org/en/docs/http/ngx_http_log_module.html</a></div>
<div dir="ltr" data-setdir="false">I can get the IP of the
Internet use</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">How can I get the IP of the
Internet user when it generates an error log ?</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">Thank you<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div dir="ltr" data-setdir="false"><br>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
nginx mailing list -- <a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
To unsubscribe send an email to <a class="moz-txt-link-abbreviated" href="mailto:nginx-leave@nginx.org">nginx-leave@nginx.org</a>
</pre>
</blockquote>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>