This is great! I didn't know that volume II has been published...<p>Also be sure to read the chapter about LLVM compiler family (written by LLVM creator, who is an Apple employee now): <a href="http://www.aosabook.org/en/llvm.html" rel="nofollow">http://www.aosabook.org/en/llvm.html</a><p>It's <i>great</i>. A learnt <i>a lot</i> from that chapter.<p>This book (The Architecture of Open Source Application) is a treasure trove. Just look at the index here: <a href="http://www.aosabook.org/en/index.html" rel="nofollow">http://www.aosabook.org/en/index.html</a> and tell me you don't want to skip work (or school, or whatever else is you're doing) for a week to read it all :D
My only quibble with Nginx so far is the magical order in which it evaluates <i>location</i> directives. <a href="http://wiki.nginx.org/HttpCoreModule#location" rel="nofollow">http://wiki.nginx.org/HttpCoreModule#location</a><p>On more than one occasion, you have to unintuitively try to figure out whether a rule at the bottom is getting matched before a rule at the top. The matching algo is quite intricate and easy to to trip up on. It tries to help novices by matching literal strings first <i>for them</i> rather than simply making a note of the performance benefits of putting literal locations at the top, but ends up failing to reveal the true matching order at a glance - you need to check the verbose logs, yuck.
<i>Another problem with the existing worker model is related to limited support for embedded scripting. For one, with the standard nginx distribution, only embedding Perl scripts is supported.</i><p>For those looking for full featured and robust embedded scripting support in nginx, Yichun Zhang's lua-nginx-module is highly recomended. <a href="https://github.com/chaoslawful/lua-nginx-module" rel="nofollow">https://github.com/chaoslawful/lua-nginx-module</a>
My one experience with this server was quite bad. The web group we contracted used it, but would constantly run into issues us developers could have helped them with had they used Apache. Things like needing to return certain headers in the request, or return certain status codes, or do certain things handled easily by Apache's large ecosystem of modules became very grueling trials full of meetings with the contractors running the thing.<p>Just like Java is sometimes the best language to use because it has huge mind share despite the warts, sometimes Apache is the right server to use just because that's what almost everyone uses and it makes things so much easier than using something more rare.
Not in this book, but worth taking a look at if you're into reading source code for large open source projects, is Redis and Mongrel2. Both are really well written C code-bases.
I've read several times about people using the Go language's (golang) web server in conjunction with Nginx. Apparently Nginx provides some benefit that Go's web server doesn't, but I haven't seen that thing called out. Can anyone tell me what it is? Thanks. (I'd also love to see a performance comparison between these two.)
I much appreciated the article. And even more when I discovered from other commenters that <a href="http://www.aosabook.org" rel="nofollow">http://www.aosabook.org</a> is a collection of architectural description of a lot of Open-Source projects. I immediately read about sendmail by Eric Allman (<a href="http://www.aosabook.org/en/sendmail.html" rel="nofollow">http://www.aosabook.org/en/sendmail.html</a>) and I appreciated it actually more than the article about Nginx. There is a lot of wisdom in it and now I understand the reasons for some architectural decisions that have been taken for sendmail.