Staytus is a great, simple little Service Status page. Yeah you could write your own with this set of functionality, but this is a great little web application you can just use off the shelf to easily publish your service status to the web and update it in the event of any issues and/or maintenance periods.
Its recommended that you host your Service Status page completely off your own on-premise or cloud infrastructure and on a different domain to your main services; that way if you had some disaster befall your main infrastructure at least people could reach your Service Status page!
Installation
The Staytus installation guide is great you can find it here: https://blog.k.io/atech/install-staytus-tutorial following this will get you up and running in no time.
I had a problem that the download link for the example NGINX configuration file was not working, but I found another copy of it on: https://github.com/adamcooke/staytus/issues/312, which I’ve also copied below.
When you’ve downloaded this file, tweak the settings for the server_name and listen IP address as you need, then restart NGINX with: “systemctl restart nginx” and wait a few minutes for it to restart.
server {
listen 0.0.0.0:80 ;
listen [::]:80 ;
server_name status.yourdomain.com;
root /opt/staytus/staytus/public;
client_max_body_size 50M;
location /assets {
add_header Cache-Control max-age=3600;
}
location / {
try_files $uri $uri/index.html $uri.html @puma;
}
location @puma {
proxy_intercept_errors on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8787;
}
}
At this point you should be able to get to your status page at: http://status.yourdomain.com (or whatever you have set it to).
Add an SSL Certificate
Of course you’ll want to add an SSL Certificate to ensure that your status page is available over HTTPS too. Again this is pretty straightforward, in my example I’m using Let’s Encrypt who provide the certificates for free.
The instructions for installation are pretty good, you can visit: https://certbot.eff.org/instructions and then just pick the correct OS and web server to get some customised configuration steps. In my example I’m using Ubuntu 20.04 and NGINX: rtbot.eff.org/instructions?ws=nginx&os=ubuntufocal
Some things to bear in mind, you need to ensure your website has port 80 (HTTP) open to it through your firewall, and port 80 is listening on the server (before you start the process – of course, if you’ve followed the above it will be), this is because a connection is made to the URL to verify ownership, so you need this in place. You also need to ensure 443 (HTTPS) is open through your firewall to the server (running Staytus) too, so once the certificate is installed, you can verify it is working on HTTPS.
You’ll also need to ensure that there is a DNS record present in your DNS (and accessible from the Let’s Encrypt servers) that resolves to the IP address used by your server (via NAT if required).
Once these are in place, you’re all set, just follow the instructions to enable the SSL certificate, the Certbot instructions even add the correct NGINX configuration for you if you wish and you can always ammend afterwards.
When I attempted this, the only additional thing I needed to do was to run a “systemctl restart nginx” after the certificate was installed to ensure it started to be used.
Testing with Google Chrome Version 107.0.5304.107 (Official Build) (64-bit), it worked fine.
Conclusions
Hopefully that has been a helpful insight into this neat little Service Status page tool.