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.

Sometimes I need to regenerate my website. I do not want my users to see semi-generated site. I also do not want google to see 404 errors.

The best solution is to return "503" for while I my system generates new files. Is not it?

So I want my system to put special "lock" file before generating content and to remove it after it.

And I put onto my server config:

if (-f $document_root/lock ) { return 503; }

Is my solution OK or is it bad? If so, what is the best solution? Probably I can configure nginx to establish TCP connection to my system (permanent connection) and to show 503 in case of connection is unavailable? That should be better because we would not need to check filesystem each time.

Thanks!

share|improve this question
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.