Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Switching to Maintenance Mode on Production Server

Sri Maurya Kummamuru edited this page Jan 20, 2021 · 2 revisions
Warning: This page is going to be retired and this documentation will be maintained at - https://github.com/OpenConceptLab/ocl-docs/blob/main/docs/source/oclapi/admin/switchingtomaintenancemodeonproduction.md

Switching to Maintenance Mode

Connect to the server via ssh

ssh user@openconceptlab.org

Change directory to OCL directory

cd /var/www/openconceptlab

Make a copy of the maintenance page file

cp maintenance.html.original maintenance.html

Congrats you are in the maintenance mode.

Switching to production mode

Connect to the server via ssh

ssh user@openconceptlab.org

Change directory to OCL directory

cd /var/www/openconceptlab

Remove maintenance file

rm maintenance.html

Congrats you are in the production mode.

Notes

  • We change the /etc/nginx/sites-enabled/default file to make this happen.
server {
  server_name api.openconceptlab.org www.api.openconceptlab.org;
  ..........
  location / {
    if (-f $document_root/maintenance.html) {
      return 503;
    }   
    ................
  }
  error_page 503 @maintenance;
  location @maintenance {
    rewrite ^(.*)$ /maintenance.html break;
  }
}
Clone this wiki locally