6

We host our ASP.NET web sites internally (within our DMZ). When we are doing network maintenance, etc we would like to have our sites display a maintenance page, but our network is down so our hosting servers are off. We don't host our DNS entries (it is handled externally) so we could have a maintenance page hosted externally, but pushing a DNS change for maintenance would take too long. What kinds of solutions could we employ to handle network outages here while still giving our external users some indication that we still exist? What has worked for you and what have you tried?

SteveBering
  • 161
  • 1
  • 2

6 Answers6

3

An offsite reverse proxy that points to your live site could display a default page when the backend site is not available.

tomdeb
  • 709
  • 1
  • 7
  • 10
2

I use haproxy for this exact setup. It is hosted on an external Linux VPS. When the proxy system is able to successfully get the health check page on the actual web server, that's what is served to the client. When the health check fails, it serves a static page from an Apache server local to the proxy VPS.

Here is my haproxy.conf:

global
maxconn 4096
daemon
defaults
mode http
clitimeout 60000
srvtimeout 30000
contimeout 4000
option httpclose # Disable Keepalive

listen FarmName 10.9.8.7:80
        mode http
        stats enable
        stats auth admin:Fa2a6eSe
        balance roundrobin
        cookie haCookie insert nocache
        option httpclose
        option forwardfor
        option httpchk HEAD /healthcheck HTTP/1.0
        server active 1.2.3.4:5080 check
        server static-backup 127.0.0.1:80 check inter 500 rise 1 fall 2 backup
Dave Forgac
  • 3,486
  • 7
  • 36
  • 48
0

Well, I don't know if this the optimal solution, because it is adding complexity to your solution: you could place some reverse proxies (squid, MS ISA, ...) in front of your web servers (outside your network) and run the requests through these servers.

So, when you're planning for down-time, you simply have to change some rules to show the static "sorry, we're offline" message.

splattne
  • 28,348
  • 19
  • 97
  • 147
0

You could set up a DNS failover solution (DNS Made Easy provides this option), but depending on your TTL settings, people won't likely get the updates except for longer outages. Of course, you would also need an external server to host the maintenance page.

Your best bet for instantaneous failover is to purchase a small hosted server somewhere, with a static web page on it, and then use a tool (like heartbeat in linux) to monitor when the main server is unavailable, and have the secondary server take over its IP address.

Brent
  • 22,219
  • 19
  • 68
  • 102
0

Why not just provision a single workstation/server with IIS displaying a single static maintenance page? When you need to bring the web servers down you just bring up the maintenance workstation and make sure it responds to the incoming web requests...

Due to the simple static web page you could probably get away with a small/medium workstation, even perhaps a laptop... You could probably even get away with a Virtual Machine that sits offline until you need it...

Seems like everything else is more work than necessary...

Dscoduc
  • 1,095
  • 2
  • 8
  • 15
0

If you have an ASP.NET web application site, and you place a text file named "app_offline.htm" in the root of the site, all requests to that website will redirect to that app_offline.htm file.

Basically, if you need to take an entire ASP.NET site offline, you can place some nice message in that file. Then, any new requests to a URL, any URL, in that website will redirect to that file allowing you to do maintenance to the site, upgrades, or whatever. It is not really a redirect though. ASP.NET essentially shuts down the site, unloads it from the server, and stops processing any requests to that site. That is, until you delete the app_offline.htm file - then things will continue as normal and your ASP.NET site will load up and start serving requests again. 

Hope it helps. Cheers!

Madhav
  • 1
  • 1