Website offline message whilst resizing?

Posted March 8, 2018 929 views
DigitalOceanUbuntu 16.04

Are there any options to display a message to visitors whilst a droplet it powered off during a resize?

Some sort of temporary redirect to a different droplet perhaps?

Just curious if there are any options.


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.

Submit an Answer
1 answer

There isn’t a service for this available by default. Since your domain points directly to your droplet’s IP address, if a request comes in for the domain while your droplet is powered off during a resize there is nothing at that IP address to answer. One way you could achieve this would be to use another droplet as an nginx reverse proxy using the proxy_pass directive in your nginx configuration.

With this you would point your domain to the nginx proxy and it would request the data from your application server. You can also set up caching on the nginx proxy if you want which would reduce the load on your app server. With this configuration, if the droplet running your app were to go down it would trigger the nginx proxy to return a 502 error indicating that it could not reach the upstream service. By creating a custom 502 error page you could then display the page of your choice automatically anytime your app server is unavailable for any reason.