<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
<div class="moz-cite-prefix">On 5/19/2017 12:24 AM, ohmykot wrote:</div>
<blockquote type="cite"
cite="mid:d15a580290bd264945563f87e4cde486.NginxMailingListEnglish@forum.nginx.org">
<pre wrap="">
What I tried so far in my website config:
[code]
location ~* ^/secret-page/ {
allow 1.1.1.1;
deny all;
}
[/code]
But this didn't work. It returns 404 error when I try to open this page from
allowed IP. Looks like it tried to find the real file or directory
/secret-page/ rather than return a friendly URL page if I got it right.
</pre>
</blockquote>
<br>
I assume that you mean rewritten URL when you say Friendly URL?
Please paste your rewrite rule for that location.<br>
<br>
But in general I think that you should remove the rewrite rule for
that location, and add the following:<br>
<br>
Assuming that you mean a secret directory rather than page, add
alias or root directive, e.g.<br>
<pre wrap="">location ~* ^/secret-page/ {
allow 1.1.1.1;
deny all;
alias /path/to/physical/secret-dir/;
}</pre>
<br>
If it really is a single page then try:<br>
<br>
<pre wrap="">location = /secret-page/ {
allow 1.1.1.1;
deny all;
try_files /path/to/physical/file
}
</pre>
<br>
<div class="moz-signature">
<p>Igal Sapir
<br>
Lucee Core Developer
<br>
<a href="http://lucee.org/">Lucee.org</a></p>
</div>
</body>
</html>