Nginx HTTP Server Review - The Best Nginx Resource!
Even though you may not realize it, every single website you visit has an HTTP server to it. There are many HTTP servers out there, even some based upon open source projects, but the majors ones are mainly Apache (most websites use Apache), Microsoft's IIS (blah!), Nginx, and lighttpd. Nginx has been getting quite a bit attention this past year for one main reason... it's fast! As this isn't a post on Nginx vs. everything else, we won't get into which HTTP server is "the best". But if you want a post like that, feel free to post it in the comments below!
The only problem with Nginx is that there's just not enough official documentation. If you look all over the web, you will find guides, tips, and many other tutorials to get anything done with Nginx. One of the more common uses of Nginx is setting it up as a proxy to serve static files; we'll get more into that later.
With that said about documentation, it gives Packt Publishing a very good reason to write a full-blown book on Nginx. After seeing Nginx HTTP Server in the best sellers section, I knew being a server guy I just had to review it!
My Background with Nginx
I've been working on servers ever since the day I was introduced to Linux. Around four years ago, when I started to run my own websites off my servers, I was very interested in all the different ways I was able to run a website. Not too long ago (~a two years ago), one of my friends introduced me to Nginx, and I have to say, I knew Nginx was going to take off someday.
Since then, I've been working with dedicated servers, virtual servers, and even local servers running Nginx. I personally use Nginx in all of my development servers (I own many development servers). As most of my development servers have not as much memory, I need a lightweight HTTP server running on them. Nginx was my choice and I have been using it ever since the day I was introduced to it.
I won't say I know everything of Nginx's features, but I will say I know my way around it.
What's Included in the Book
In just 348 pages and eight chapters, practically everything is covered on what one might do with Nginx. Clement Nedelcu, the author of Nginx HTTP Server, did one amazing job on the only Nginx book! Not only is it written very professionally, it also covers a ton of features of Nginx. Let's see a few of the included topics in Nginx HTTP Server:
- Getting ready for setting up Nginx - learning commands, how Linux works, et cetera. I was surprised to see this section; it's for sure very helpful!
- How to download, install, and set up Nginx
- Learning Nginx's configuration, modules, and upgrading gracefully
- Performance tests - love this section! It's very much needed!
- HTTP configuration - MIME types, restrictions, request headers, etc
- Using the rewrite module (very important on modern websites), SSL module, and other modules like logs, authorization, and gzip
- Integrating Python (Django) and PHP (and PHP-FPM) with FastCGI
- Using Apache and Nginx coherently - this was my favorite section!
- Making the switch from Apache to Nginx
Essentially everything you need to know with Nginx! I was very surprised at how much content is fit into this book. Everything one might do with Nginx is right in Nginx HTTP Server!
This Book is Awesome!
I really have to say with all my heart, if you want to learn everything about Nginx, you want to pick up a copy of Nginx HTTP Server! When just reading Nginx HTTP Server, I realized that this is quite literally the best and only Nginx book out there.
One thing I really enjoyed about Nginx HTTP Server is that in the very beginning of the book, Clement explained the basics of Linux and how to prepare for Nginx. This by far wasn't needed, but I was very impressed to see an entire chapter on this type of matter. Even if you are not a server administrator, you'll be able to follow along with no hassle at all.
Lots of modules are covered...
What's essential to every web-server, modules are very much needed no matter to add some key functionality, some of the biggest being SSL, gzip, and authorization. Without these modules, some websites will fail to work. In Nginx HTTP Server, every essential module is covered in a very easy to understand way. Now you might be thinking, is the rewrite module covered? Actually, Nginx HTTP Server covers the rewrite module in two main sections of the book! He first introduces the rewrite modules and how everything works along with how to set it up with the common rewrite rules. But what makes this special, is that in the "From Apache to Nginx" section, Clement actually has an entire section on how to set up the rewrite rules for WordPress, MediaWiki, and vBulletin. I was very impressed to see this section because quite honestly, I had problems setting up the rewrite module with some of these systems before. Having a book by my side is a big plus; especially for the fact that so much is covered!
It's organized...
What made me really love Nginx HTTP Server isn't that practically everything of Nginx is covered, it's mainly for the fact that it's covered in an organized way. Configuration is a critical part in Nginx HTTP Server. For many of the sections covered in the book, configuration of something for Nginx is needed. When setting up an HTTP server as vast as Nginx, one may get lost when setting up the configuration files. Nginx HTTP Server fixes that issue by going through the configuration settings needed to get said feature working.
Talks about the rather essential PHP and even Python...
This isn't just a book on Nginx. If this was a book on Nginx, it wouldn't be enough to get an entire server working. In fact, Nginx HTTP Server covers integration of Python and PHP! I was expecting PHP to be in a book on Nginx, but having Python being covered as well is one huge plus for me. FastCGI, which what Nginx uses to communicate with other gateway applications like PHP, is even explained on why it's better than the older, slower technology called CGI. Not only that, but in the same chapter, Nginx HTTP Server explains how to offload requests to backend servers for an efficient load-balancer. Not only that, but most of this chapter explains how to set up PHP and Python. I have to say, I've never seen such a broad explanation of how to set up Nginx before reading Nginx HTTP Server. Quite frankly, there's so much covered in Nginx HTTP Server that I cannot talk about in this review.
Migration from Apache to Nginx is covered...
One critical chapter in Nginx HTTP Server is the migration from Apache to Nginx. This section explains what Nginx modules can be used to replace those Apache modules along with implementing something like .htaccess files. And of course, everything is explained on how to move from your Apache configuration file(s) to Nginx's configuration. The one tricky thing, however, with .htaccess files is that there is really no such thing in Nginx. The author could have completely skipped this section, but he however offered some intelligent solutions on fixing this issue. But the thing is, these solutions aren't per se ideal in a shared hosting environment. So essentially, this is one reason why shared hosts do not use Nginx.
Maybe a Bit Too Much?
When looking at the table of index in Nginx HTTP Server, you will quickly realize there's quite a bit covered. Whether this is a good thing or not, maybe you can have a bit too much.
As mentioned before, in the very beginning of the book, Nginx HTTP Server teaches you the basics of Linux. As I appreciate this for the new users, it maybe a bit too much information for a book on Nginx. Maybe you should save that for a book like Linux Shell Scripting Cookbook. As Linux is so vast, it seems that most of the first chapter would be a better fit in a separate book. The author could of mentioned further reading also.
But in the long run, I guess you can never have too much information in a book. I don't think anyone will really complain about it anyways. The Linux junkies will just skip over it anyways.
Final Thoughts
Overall, I have really enjoyed reading Nginx HTTP Server. With all of the vast amount of information available in this book, I'm sure I'll be referring to it in the future. If want to pick up the best and only book/reference guide on Nginx, click on the link below to visit Packt Publishing's website:
http://www.packtpub.com/nginx-http-server/book
Read hosting reviews that describes the term dedicated servers and lists other pages on the web where you can find additional information.
Stalk me on social media! Any other way would just be creepy…
Follow me: