<div dir="ltr">wouldn't you use<div><br></div><div>location /secret-page/ {</div><div> deny all</div><div> allow <a href="http://1.1.1.1/32">1.1.1.1/32</a>;</div><div>}</div><div><br></div><div>a</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 May 2017 at 17:24, ohmykot <span dir="ltr"><<a href="mailto:nginx-forum@forum.nginx.org" target="_blank">nginx-forum@forum.nginx.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
I've got a server with nginx and a wordpress website running on it.<br>
<br>
On the web-site, I have a wordpress page, i.e. <a href="http://domain.com/secret-page/" rel="noreferrer" target="_blank">domain.com/secret-page/</a>, that<br>
I want to restrict access to everybody but 1 specific IP address of my other<br>
server.<br>
<br>
As this page is not a real physical directory, but just a friendly URL - I<br>
got stuck. I don't have previous experience configuring nginx, but I tried<br>
hard to google the possible solution.<br>
<br>
What I tried so far in my website config:<br>
[code]<br>
location ~* ^/secret-page/ {<br>
allow 1.1.1.1;<br>
deny all;<br>
}<br>
[/code]<br>
<br>
But this didn't work. It returns 404 error when I try to open this page from<br>
allowed IP. Looks like it tried to find the real file or directory<br>
/secret-page/ rather than return a friendly URL page if I got it right.<br>
<br>
Can you help me please?<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,274314,274314#msg-274314" rel="noreferrer" target="_blank">https://forum.nginx.org/read.<wbr>php?2,274314,274314#msg-274314</a><br>
<br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>