How to restrict acces to specific friendly URL by IP in Wordpress site?

Aleksandar Lazic al-nginx at
Fri May 19 23:41:08 UTC 2017

Am Fri, 19 May 2017 03:24:43 -0400
schrieb "ohmykot" <nginx-forum at>:

> Hi!
> I've got a server with nginx and a wordpress website running on it.

what's the output of nginx -V?

> On the web-site, I have a wordpress page, i.e.
>, that I want to restrict access to everybody
> but 1 specific IP address of my other server.
> As this page is not a real physical directory, but just a friendly
> URL - I got stuck. I don't have previous experience configuring
> nginx, but I tried hard to google the possible solution.
> What I tried so far in my website config:
> [code]
> location ~* ^/secret-page/ { 
> allow; 
> deny all; 
> }
> [/code]

Where is this code in the nginx conf?

What's in the error log?

Can you try to run the debug log?
An then would be the error log output interesting.

In some distributions is it necessary to run nginx-debug instead of


More information about the nginx mailing list