Welcome! Log In Create A New Profile

Advanced

Using "if -f" to return 503 for maintenace: good or bad?

July 15, 2012 07:42PM
Hello,

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!
Subject Author Posted

Using "if -f" to return 503 for maintenace: good or bad?

IlyaK July 15, 2012 07:42PM

Re: Using "if -f" to return 503 for maintenace: good or bad?

DeineAgentur July 18, 2012 02:25PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 308
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready