Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site in development, I want only my IP to access the website and block all other IPs. I could do that with allow in Nginx and deny all. However I want other visitors to see just one page index.html which says:

Welcome to The site, Stay Tuned

how to make only one page accessible for global users like that in Nginx ?

I tried with error_page like

location / {
deny all;
error_page 403 index.html;

but this creates redirects and I get the website has too many redirects while accessing from other ip.

share|improve this question
up vote 1 down vote accepted

You need to allow access to the error page in a matching location.

location = /error403.html {
    allow all;

location / {
    error_page 403 /error403.html;
share|improve this answer
thanks for prompt response... this is what i was looking for – Jhilke Dai Mar 25 '13 at 17:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.