Answers.Body: <p>I realized there is a simpler solution after stepping away from this issue for a bit. There is one page that still returns a 200 code on a Craft site even when the <code>isSystemOn</code> (or <code>isSystemLive</code> as of Craft 3.1) is <code>false</code>. Using the <strong>control panel login page</strong> as a health check url is the solution. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-26T12:20:04.447Z
Answers.LastActivityDate: 2018-12-26T12:20:04.447Z
Answers.UserDisplayName: John Morton
Answers.Body: <p>Just have that page not be in the CMS. Create something like <code>web/ping.html</code> and point the monitoring service at that static file.</p>
  
  <p>If you want it to work anyway, you could have an <code>offline.html</code> template, and you could change the status code that it returns... but that would be a little weird.</p>
  
  <p>It was changed to <code>isSystemLive</code> btw... more info here: <a href="https://nystudio107.com/blog/handling-errors-gracefully-in-craft-cms#offline-staging-sites" rel="nofollow noreferrer">Handling Errors Gracefully in Craft CMS</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-29T02:37:22.143Z
Answers.Text: A static file wouldn't work well as a health check. We also use `/admin/login` as a health check as you have more assurance that PHP and Craft are well.
Answers.UserDisplayName: Steven Shaw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-30T01:43:35.320Z
Answers.Text: Makes sense, it's true that a static file will only tell you that the server and webserver are up and working, not that PHP and Craft are well.
Answers.UserDisplayName: andrew.welch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-24T16:29:47.143Z
Answers.LastActivityDate: 2018-12-25T15:07:45.627Z
Answers.LastEditDate: 2018-12-25T15:07:45.627Z
Answers.UserDisplayName: andrew.welch
Body: <p>I have a staging site that has the <code>isSystemOn</code> set to <code>false</code> since I don't want people to stumble upon the site and be able to view content. I would like to have <strong>1</strong> page still "visible" though. This URL would a simple <em>health check</em> page, that I direct a monitoring service to check on. I'm stumped at overriding a system level <code>isSystemOn</code> config setting. </p>
  
  <p>Can I have <code>staging.example.com/my-secret-health-check-url</code> return a valid code of <code>200</code> so my monitoring service can correctly see that my staging site is working?</p>
  
Tags: <craft3><config>
Title: Overriding isSystemOn setting for a single page
ThreadText: # Overriding isSystemOn setting for a single page
  
  (Asked by: username_0 on 2018-12-24)
  
  I have a staging site that has the `isSystemOn` set to `false` since I don't want people to stumble upon the site and be able to view content. I would like to have **1** page still "visible" though. This URL would a simple *health check* page, that I direct a monitoring service to check on. I'm stumped at overriding a system level `isSystemOn` config setting.
  
  Can I have `staging.example.com/my-secret-health-check-url` return a valid code of `200` so my monitoring service can correctly see that my staging site is working?
  
  **Tags:** craft3, config
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-12-26. Score: 6
  
  I realized there is a simpler solution after stepping away from this issue for a bit. There is one page that still returns a 200 code on a Craft site even when the `isSystemOn` (or `isSystemLive` as of Craft 3.1) is `false`. Using the **control panel login page** as a health check url is the solution.
  
  
  ---
  
  ### Answer by username_1 on 2018-12-24. Score: 2
  
  Just have that page not be in the CMS. Create something like `web/ping.html` and point the monitoring service at that static file.
  
  If you want it to work anyway, you could have an `offline.html` template, and you could change the status code that it returns... but that would be a little weird.
  
  It was changed to `isSystemLive` btw... more info here: [Handling Errors Gracefully in Craft CMS](https://nystudio107.com/blog/handling-errors-gracefully-in-craft-cms#offline-staging-sites)
  
  > **Comments:**
  > **username_2**: A static file wouldn't work well as a health check. We also use `/admin/login` as a health check as you have more assurance that PHP and Craft are well.  
  > **username_1**: Makes sense, it's true that a static file will only tell you that the server and webserver are up and working, not that PHP and Craft are well.  
  
  ---
  
  