Maintenance Mode


#1

There are many cases where the website should be temporarily brought down.
Moving server, software upgrade that requires an outage, you name it.
It would be natural and logical if Maintenance Mode could be turned on in the Cloudflare admin console.
Is there a way to turn on maintenance mode directly on Cloudflare?


Moving site connected to Cloudflare to new hosting
Maintenance Mode?
#2

What would a Maintenance Mode do?


#3

Maintenance Mode would display a static landing page to all users trying to access the website.

E.g. “Site is temporarily offline for maintenance, please come back later.”

In the meantime site admin could safely do their job, migrate the DB, etc.


#4

This sounds like a job for a Cloudflare App, though if all users got the Maintenance mode page, I’m not sure how you’d be able to admin the site.


#5

Admin could add their ip-address in CF as an exception or access the site directly by IP-address.


#6

Is what you are describing something like Always Online, but with the option to customize the page and deploy on demand?


#7

I don’t think so (though I haven’t tried), as AO is not likely to start working on demand on dynamic pages that were previously uncached. Edge servers will not have cached versions of such pages, and while site is offline, there is nowhere to get those pages from. Also all form submissions will fail leaving users in frustration, as they will not know what happens and why. Overall, this option does not look like an adequate replacement for the Maintenance Mode.


#8

Anyway, can’t tell for sure, depends on how exactly it’s is going to be implemented. What I suggest is a simple solution that switches the site off for a while replacing all URLs with one static page. There may be options, like “turn MM on for all sites on this ip-address”, but overall it should be simple I believe.


#9

Sorry. I didn’t mean to suggest it would work now. Just if that tech could be leveraged somehow.


#10

This is more or less possible with custom error pages and lockdown rules. Lockdown rules display the IP/Country custom block page to visiting clients, so if you create a lockdown rule for your entire domain and only allow access to your own IP, you can use the custom block page to display a maintenance message.

This isn’t perfect, as there’s no separate customization option for the maintenance page, so you’d need to swap out that page with the default or your normal custom block page every time you close the site for maintenance. Lockdown rules are also currently API-only, so there’s no simple button in the UI to start/end maintenance.


#11

I cant imagine why this doesn’t exist already. Asking “what would it do?” seems a little unnerving, since it is one of the most common things in the world for web applications to need?


#12

Add a Maintenance Mode and display a specifc page for single domain, subdomain or all site, in case of transfer hosting or others i think is a good idea =)


#14

You could easily do this with CloudFlare workers - Here’s an example :slight_smile:

https://www.resdevops.com/2018/03/20/cloudflare-workers-maintenance-mode-static-page/

Workers are pretty powerful and affordable.


Recipe Request Thread
#15

Sweet!