Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As I prepare to test some changes, I thought I'd set up a maintenance page block so I could do the testing.

Just realized though that the maintenance block examples for nginx take the site down for everyone.

How do you serve the maintenance page to visitors will still allowing localhost access.

Should I just create a new server block listening on another port and deny all, allow 127.0.0.1?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The way I do it is I have two copies of my site, one which is live and one which is development. I do a svn checkout to my development which and test it on there, and when changes are tested and ready I rsync them into my live environment.

Having a maintenance page because you're making changes really shouldn't be necessary unless you're making changes to for example a database where queries take several minutes to run.

But to answer your actual question, location blocks doesn't care about who is requesting the page, only about the URI. One work around would be to use the access module to deny access to anyone not you and then define the error page to be a maintenance page.

share|improve this answer
    
Sorry for the late thanks! Just looking over my account and realized I never responded. –  Ian Apr 26 '11 at 2:55

Your Answer

 
discard

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.