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.