5 ms·
Is it really that hard to add 5 lines of boilerplate to your nginx conf? You can probably just copy-paste an existing server{} block or sites-available file an
by dangerlibrary 13y ago
Is it really that hard to add 5 lines of boilerplate to your nginx conf? You can probably just copy-paste an existing server{} block or sites-available file and change the root directory. As a bonus, you'll learn a bit about how to configure the same tool you'll use later in production.
Oh. It's written in Go. Got it.
- rif 13y agoDoes 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.
- dangerlibrary 13y agoYou 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"
- rif 13y agoYou 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 :)
- theonewolf 13y agoThe way I'd do this is have front-end load balancers just re-direct to a nginx configured just for this purpose.
- dangayle 13y agoYes it does, although not out of the box: http://wiki.nginx.org/HttpEchoModule http://wiki.nginx.org/HttpEchoModule
- rif 13y ago:)
- georgebashi 13y agoYou 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>";
- sanderjd 13y agoI'm so sick of seeing this pattern of 1) person makes tool they find useful, 2) person releases tool publicly for free, 3) other person comes across tool but doesn't find it useful, 4) other person publicly denigrates tool as being universally not-useful. I just don't get it.
- dangerlibrary 13y agoI don't think I said anything negative about the tool itself, or about the author of the tool, who seems perfectly happy with it. You're right that I don't think it's useful to have a proliferation of tools that do one thing worse than a general-purpose tool. I don't want an avocado peeler - I'll use a knife and I'll recommend using a knife to others.
- reeses 13y agoIt's your tone more than anything. I read some of your previous posts to see if you were a d-bag and I came to the conclusion that you're not[1]. This reads more like the post was a button-pusher for you. I can relate. :) Unfortunately, even with the tone removed, the comment hits that "top-voted middlebrow" button for many of the other people on the site. I would however say that for TFA itself as well. [1] the opinion of some random interdweeb carries a lot of weight, I know. :)
- mverwijs 13y agoGreat. Good for you. Your initial comment, however, is filled with a denigrating tone. It is that tone your parent is addressing. Not so much the content. The tone. It is unkind.
- deleted 13y ago[deleted]
- tzury 13y ago@dangerlibrary simply says: Do not re-invent the wheel. I cannot see any real-world production environment where this new server is better approach then activating a tiny config file. Thus, it is a very good lesson to the author: Use what is out there and build what is missing.
- a-nom-a-ly 13y ago# pgrep nginx #