How to implement an HTTP output filter in nginx

Internally nginx HTTP server has a stack of output filters. These filters affect the reply generated by other sources, such as phase handlers or upstream. There are 2 types of output filter: header filters and body filters. Obviously, header filters apply to the header of the reply and body filters apply to the body of […]

Getting cookie value in nginx

nginx allows you to extremely easily extract the value of a cookie. Simply use $cookie_<name> meta variable in whatever context you need. Here is an example: location / { proxy_set_header X-Session-id $cookie_sid; proxy_pass http://upstream; } In this configuration snippet we pass the request to the upstream named “upstream” and extend it with a header “X-Session-id” […]

Should you trust a free SSL certificates?

Risk management in business is everything. In fact it’s the main job of an entrepreneur to manage risks related to the business. One of the tools to manage risk is a binding contract. By means of a binding contract it is possible to hand over some risk to another party in exchange for a fee. […]

Let’s welcome the fluid time

Industrial revolution made a profound impact on our perception of time. Before the pendulum clock was invented around middle of the seventeenth century people perceived time differently. Time was not something related to a periodic rhythm, but rather solar activity. If you asked somebody “what time is it now”, you’d get an answer like: “the […]

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 subtleties known to those who have deep understanding of Nginx core. At the same time, […]

Distributed caching using Redis

And so, 2 weeks after I’m about to complete my first project on my own. I’m working on a distributed cache module for Nginx that stores cached content in Redis. Redis is a superfast persistent key-value storage that is easy to integrate and easy to work with. The choice fell on Redis because

The value of qualitative programming

Imagine that you run an online service company and you do some service for people and your business becomes so big that your departments no longer fit in entire floors of a big building and your budget is so big, that you don’t give a damn of caring about people and raising their salaries, because […]

Queueing systems

Queueing systems manage and process queues of jobs. The presence of a queue implies that something cannot be done immediately and one has to wait until some resource is available. When you respond to an HTTP request you usually want to do it interactively, that is, you want to respond within some reasonable amount of […]

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 several requests to release them. Today I release these modules under free licence. Meet the […]