Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Slightly off-topic, but I'm sad that people still use apt-get. aptitude is pretty much just better[1].

Also, if you're reading this article you probably don't need the slightly better performance/throughput of nginx. Nginx's configuration is just terrible. You can cause segfaults and all sorts of unexpected behavior with the If directive[2]. And who came up with the idea that rewrite[3] should sometimes redirect instead of rewriting?

If the replacement string begins with http:// then the client will be redirected, and any further rewrite directives are terminated.

Apache's configuration might be ugly and unwieldy and the community might be horribly infested, but at least the configuration makes sense. Lighttpd has none of the above problems, though.

[1] http://superuser.com/questions/93437/

[2] http://wiki.nginx.org/IfIsEvil

[3] http://wiki.nginx.org/HttpRewriteModule#rewrite



I'm extremely biased as I have been using NginX for many years now; however, I've got to completely disagree with you.

NginX's configuration is beautiful, elegant, and concise. It kicks the ever living crap out of configuring Apache or Lighttpd (the two other HTTPd's I have extensive experience with). It seems so strange, because it's different.

NginX's configuration language is declarative. If is imperative and actually using if inside locations in NginX creates an inner location and executes a mini language to process.

    14:42 <+merlincorey> !ifisevil
    14:42 < ngxbot> please see above
Please see http://wiki.nginx.org/IfIsEvil for more about that in particular.

Finally, I have to disagree with OP... NginX has great documentation, written by Igor himself initially (and edited by the community) available here: http://nginx.org/en/docs/


Yes, I linked to IfIsEvil. The fact that you need a page to document the horrible behavior because it's too late to fix it is a sign that something is very wrong with the config syntax.


The fact that you think it is a problem with the configuration syntax is an indication that you didn't read the wiki page, or the important part of my comment.

NginX's configuration is declarative.

The reason the imperative if was given powers beyond its means was because people clamored for the feature.

The reason it's still there is because removing it would break some working configurations that use if.

If you don't have experience with declarative programming and you think in terms of imperative programming, it might seem "horrible behavior", but actually, it's what is to be expected from mixing the two paradigms in the way it is being mixed.

The real wart is under the hood where-in location based if's are converted to sub-locations. This is where many problems related to IfIsEvil stem from.


I'm rather annoyed that you're not reading anything I've said.

No, the problem is not that I haven't read the page. I have. It can cause segfaults. Your configuration can cause segfaults. Your configuration can cause segfaults. Your configuration can cause segfaults.

And yes, I acknowledged that they can't remove it because it's too late, using those exact words. That doesn't mean it's not a problem. It means you should jump ship to something saner, like lighttpd, which also doesn't have the rewrite-sometimes-redirects problem.


> Your configuration can cause segfaults.

MY configuration never causes segfaults, because I understand the declarative nature of the configuration language, and I don't mistakenly attempt to shoehorn imperative constructs into it.

By your logic, software should not be written in C/C++, because it can cause segfaults!

> It means you should jump ship to something saner, like lighttpd,

Ah, you're a lighttpd guy. I'll stick with not having the http server also be an application server, and we'll agree to disagree.

Have a nice day.


I was using "your" in the third-person, a quirk of the English language that is too late to fix.

Configuration should not be able to cause your software to segfault. Configuration shouldn't be software. And, in case it's not clear, configuration should not be written in C/C++.


Aptitude is awesome and it's in my fingers, but it's slightly different from apt-get... which may turn into a problem if you do stuff with something like puppet, which uses apt-get.

I think I also had to install aptitude on this box (ub 12.04) as it only came with apt-get installed - apt-get is more universal.

Edit: Hrm. 'aptitude' is not the tool of choice for dist-upgrading Debian. I was fresh-installing my debian laptop last year from testing to sid and it was failing to work properly. Hunting down the issue online, it turns out that for dist-upgrades, you just use apt-get. One of those domain-knowledge gotchas :/ Used apt-get, and it went flawlessly.


Well Ubuntu doesn't ship aptitude by default any more which would explain parts of it.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: