<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Based on your configuration snippet there doesn't appear to be
anything wrong.</p>
<p>Except for the fact that
"/etc/nginx/html/_upload/article/files/d7/c2.xlsx" doesn't seem to
exist on system. Which means either your document root is set
wrong for your server block, or you actually don't have a file in
that path that it's trying.</p>
<p><br>
</p>
<p>Thomas</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 6/18/21 10:32 AM, baalchina wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAbBLB1ygZQf2DRAJv873_Esw9AUinyX46ePVgKS3+9GVz4VTA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi all,
<div>I am using nginx as my reverse proxy, and I do not want all
Excel files in my server to be accessed in the internet. So I
add this in my nginx.conf:</div>
<div><br>
</div>
<div> location ~* \.(xls|xlsx)$ {<br>
allow <a href="http://10.0.0.0/8"
moz-do-not-send="true">10.0.0.0/8</a>;<br>
deny all;<br>
}<br>
</div>
<div><br>
</div>
<div>while my intranet address is <a href="http://10.0.0.0/8"
moz-do-not-send="true">10.0.0.0/8</a>. I found in internet,
nginx return a 403 error, that's correct.</div>
<div><br>
</div>
<div>But in my intranet, which ip in <a
href="http://10.0.0.0/8" moz-do-not-send="true">10.0.0.0/8</a>,
nginx return a 404 error. I looked the error.log, it return
like this:</div>
<div><br>
</div>
<div>[nginx][error] open()
"/etc/nginx/html/_upload/article/files/d7/c2.xlsx" failed (2:
No such file or directory), client: 10.0.0.1, server: xxxxx
request: "GET /_upload/article/files/d7/c2.xlsx HTTP/1.1",
host: "xxx", referrer: "xxx"<br>
</div>
<div><br>
</div>
<div>So, is there anything wrong in my config file?</div>
<div><br>
</div>
<div>Thanks.</div>
<div><br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">from:baalchina</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></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>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre>
</blockquote>
</body>
</html>