Category Archives: nginx
Nginx Essentials is available for pre-order
Nginx Essentials is available for pre-order! This is my first book ever and my first book about Nginx. The book is conceived as “programmer’s view of Nginx administration” and intends to enrich web masters’ and site reliability engineers’ knowledge with … Continue reading
Logging modules re-released!
Few months ago I shut down the pages of nginx socketlog module and nginx redislog module. This is due to excessive volume of support they required. Some people, however, found that these are interesting pieces of technology and I got … Continue reading
Counting unique visitors
In version 1.0.2 of redislog module I added a feature that allows you to do conditional logging. What can you do with it? For example, logging only unique visitors. E.g.: userid on; userid_name uid; userid_expires 365d; access_redislog test “$server_name$redislog_yyyymmdd” ifnot=$uid_got; … Continue reading
Better logging for nginx
Somehow the problem of logging was not completely addressed in nginx. I managed to implement 2 solutions for remote logging: nginx socketlog module and nginx redislog module. Each of these modules maintain one permanent connection per worker to logging peer … Continue reading
Configuration directives
In one of the previous articles I discussed the basics of HTTP modules. As the power of Nginx comes from configuration files, you definitely need to know how to configure your module and make it ready for variety of environments … Continue reading
Measuring time spent on page
One of the challenges of A/B testing is insufficient observations due to low traffic. In other words, if you measured the conversion rate on our web site, it would take months or even years before we’d get conclusive result. What … Continue reading
An HTTP module basics and configuration
In the previous article I explained how modules of all types link into Nginx. Now let’s look closer at the specifics of HTTP modules. An HTTP module has the value NGX_HTTP_MODULE in its type field and the ctx field points … Continue reading
How your module plugs into Nginx
In previous articles I have deliberately omitted almost everything related to the question of linking your module with Nginx. It is important, however, that you know about it. Let’s take a closer look at the metainformation that your module must … Continue reading
Working with cookies in a Nginx module
Imagine you run a PPC advertising campaign and you want to find out how many visitors coming from a search engine result in sales. We will create an Nginx module and use cookies for this purpose. Whenever a visitor clicks … Continue reading
How to return a simple page
Let’s see what we need to do in order to return a simple page to a client using Nginx module. We need to generate a header and a body of the response. To send a response header we use function … Continue reading