Nginx X-Accel-Redirect with proxy_pass and Host change..

I already wrote about using Nginx and X-Accel-Redirect. But today I would like to get back to it, since recently I’ve spent a lot of time trying to solve similar problem..

The problemo

We have a cdn in front of our sites and multiple pointers to static assets like etc.  …

Continue reading  »

AWS AutoScale with SPOT instances and dynamic tagging

I was always fascinated by idea of fully automated infrastructures, where instances come and go according to particular factors like network traffic or load increase and you just observe this process form the distance allowing system to heal itself.

Now that these days we mostly deal with Cloud providers and their great APIs,  …

Continue reading  »

Internal redirect to another domain with proxy_pass and Nginx

Let say we have multiple sites and and created some shared resourse (widget) under For simplicity just imagine Disqus where you need to embed comments widget (shared resourse) to every site, but don’t want to deal with AJAX “same origin policy” problems and Iframes ( actually sometimes Iframes are not so bad and could be used with care,  …

Continue reading  »

Use Nginx to proxy files from remote location using X-Accel-Redirect

Nginx supports X-Accel-Redirect for local files with no extra hassle, but what happens if you need to serve files located in some remote location like s3 and you don’t want to expose direct urls to the files? Sometimes you may want that to have control over stats or to keep an option to migrate to another file server without changing original urls.  …

Continue reading  »

Percona mysql install problem with Chef on Linode – be aware!


Fresh Linode instance of Ubuntu 12.04 LTS.

Super simple recipe ( stripped down for debugging ).

include_recipe "apt"
include_recipe "ohai"

include_recipe "mysql::percona_repo"
include_recipe "mysql::server"

I tested installation numerous times with the same OS version with Vagrant with no problems,  …

Continue reading  »

Provision and Bootstrap AWS instances with Chef

This is continuation of the previous post called Provision with Chef – baby steps. Today we going to talk about the process of bootstrapping instances with Chef used by FastCompany

At this point I assume that you already got chef repo setup and wondering how you could use it to configure your fresh instances.  …

Continue reading  »

Mastering chef-solo: deploy to target machines and automatic run on boot

This post will cover some basics behind chef-solo and the way I use it to configure machines.

With recent changes to attributes introduced in Chef 11 chef-solo became even more useful for small infrastructures and testing cookbooks with Vagrant.


As you probably already know chef can function in two modes:

  • chef client and server ( one server many clients ) –  …

Continue reading  »

Secure data bag items with chef solo

How to generate encrypted data bag item with knife and chef-solo

This post is mostly a memo to myself, because I often forget how to how to create encrypted data bag items..

Here is the deal. We know how to generate regular data bag items with knife: knife data bag create DATA_BAG_NAME DATA_BAG_ITEM ( for those who didn’t know ).  …

Continue reading  »