News for hackers. Stuff that matters.
Re:Spark web server by rif on Wednesday February 12, 2014 @11:44AM (#7225313)
Does nginx have a directive for serving this text quickliy:

<h1>Maintenance</h1><p>will be back soon!</p>

Oh. It's written in C. Got it.

Re:Spark web server by dangerlibrary on Wednesday February 12, 2014 @11:49AM (#7225350)
You still need to stop the existing web server to get spark to take over port 80, and restart it when you are done, so it's not quite that simple.

Also, it's not hard to keep a maintenance conf file around, pointing to a different directory. At least, it's certainly no harder than downloading a second web server. Then it's just "sudo ln /etc/sites-available/maintenance /etc/sites-enabled/conf"

Re:Spark web server by rif on Wednesday February 12, 2014 @11:52AM (#7225378)
You are so right, still I had a need for such a little tool and I don't regret any of it's 48 lines of code so far :)
Re:Spark web server by theonewolf on Wednesday February 12, 2014 @12:32PM (#7225732)
The way I'd do this is have front-end load balancers just re-direct to a nginx configured just for this purpose.
Re:Spark web server by dangayle on Wednesday February 12, 2014 @12:55PM (#7225951)
Yes it does, although not out of the box:

http://wiki.nginx.org/HttpEchoModule

Re:Spark web server by georgebashi on Wednesday February 12, 2014 @01:49PM (#7226382)
You don't actually need echo, you can use return from the rewrite module (which is compiled in by default).

    return 503 "<h1>Maintenance</h1><p>will be back soon!</p>";
Re:Spark web server by rif on Wednesday February 12, 2014 @01:53PM (#7226418)
lol, I love hackers :)
Re:Spark web server by dangayle on Wednesday February 12, 2014 @04:46PM (#7227573)
Oh yeah. That's rad.
Re:Spark web server by rif on Wednesday February 12, 2014 @01:20PM (#7226155)
:)