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!
Accepted Answer
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:
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.