Answer the question
In order to leave comments, you need to log in
How to make a stub during technical work?
Actually the question itself :)
For now, see this way:
On the site database, make a field that will be responsible for the status of the site - 1 regular mode, 2 - maintenance.
When transferring to maintenance, we change the value in the database. We throw off all sessions from the site (using gem devise) and when logging in we check the status of the site and user rights, if the service is then when logging in (if there are no admin rights) we redirect to a page with 503 and the text - maintenance ...
Of course, you can stupidly block access altogether , but you need to leave access to the site to admins.
What other ideas are there? Is there a general practice?
Answer the question
In order to leave comments, you need to log in
On one of the projects we use the following config:
...
if (-f /var/www/project/deploy) {
return 503;
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.html break;
}
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question