Consider the following: I have a Droplet currently working and configured, with a domain pointing to it, serving something from some port (for e.g. nginx serving a website on 80/443, or a mySQL on 3306).
I’d like to configure for the domain a 503 (Service Unavailable) page when Droplet is currently Turned off, is in a process (for e.g. restarting, re-scaling) or when it’s not serving something on said port (for e.g, Droplet is on but mysql or nginx daemons are off because either crashed or I’m currently giving maintenance).
How can I serve said HTTP response on each of these cases? This is a lot better than simply having the domain give dns/timeout error.
Thank you.
This question from 2014 asks the same thing, but the response given totally hit the mark, like the person didn’t even try to read the question and just blindly answered the inner questions, which were suppositions/thoughts.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there @RaphaelDDL,
As the Droplet would be down, you would need another service in front of the actual Droplet that would be able to serve a maintenance page for example.
There are a couple of things that I could suggest:
https://www.digitalocean.com/community/questions/haproxy-change-503-page-with-a-custom
If you decide to go with that option, you could take a look at this introduction tutorial here:
https://www.digitalocean.com/community/tutorials/an-introduction-to-haproxy-and-load-balancing-concepts
If you are not familiar with HAProxy, you could achieve the same setup with Nginx as well.
http://cloudflarepreview.com/preview-cpage?act=preview&target=cf-error%3A500s
Hope that this helps! Let me know if you have any questions. Regards, Bobby