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?
What would a Maintenance Mode do?
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.
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.
Admin could add their ip-address in CF as an exception or access the site directly by IP-address.
Is what you are describing something like Always Online, but with the option to customize the page and deploy on demand?
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.
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.
Sorry. I didnāt mean to suggest it would work now. Just if that tech could be leveraged somehow.
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.
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?
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 =)
You could easily do this with Cloudflare workers - Hereās an example
https://www.resdevops.com/2018/03/20/Cloudflare-workers-maintenance-mode-static-page/
Workers are pretty powerful and affordable.
Sweet!
IS this already available? Would be nice, if youāre going to have a huge maintance on your dedicated server. For example new install OS from scrach, etc.
Page Rules and Workers can handle this pretty good already.
I wouldnāt even bother with a Page Rule. Iād use an HTML worker and assign it to the route *example.com/*
HTML for a page can contain embedded CSS and Images/favicon, even. Then youād have a single-resource Maintenance page.
Thereās a simple Terraform module to create a maintenance page GitHub - adinhodovic/terraform-cloudflare-maintenance: Terraform module to create a responsive Maintenance Page using Cloudflare Workers.. Creates a worker, route and a static html page.
It is a good suggestion for maintenance mode on-demand, but how automatically reroute traffic from app.subdomains.com to my worker if something wrong with the subdomain origin?
I am a bit baffled as well this isnāt a feature. Basically just a easy switch like you have for ādevelopment modeā and āI am under attackā. If you could just turn on maintenance mode which would redirect all traffic to a static html page, or even just a specific URL. All I need to do is do a server upgrade and restart the server, so would be nice to easily and quickly be able to turn on/off maintenance mode. I have looked at some of the tutorials for workers and routes, however it doesnāt look so easy! Guess Iāll have to set aside time to figure it outā¦