In this post we start out with the basics of unix sockets and finish by creating our own simple Ruby application server which can be proxied by nginx. Ruby application servers are typically used together with a web server like nginx. When user requests a page from your Rails app, nginx delegates the request to the application server. But how exactly does that work? How does nginx talk with unicorn
![How unicorn talks to nginx - an introduction to unix sockets in Ruby](https://cdn-ak-scissors.b.st-hatena.com/image/square/210f49ba4c4648192f3a6ac3892033d2a7b7b161/height=288;version=1;width=512/https%3A%2F%2Fondemand.bannerbear.com%2Fsignedurl%2FnZ52rq9EkQ6V3bp1Lj%2Fimage.jpg%3Fmodifications%3DW3sibmFtZSI6InRpdGxlIiwidGV4dCI6IkhvdyB1bmljb3JuIHRhbGtzIHRvIG5naW54IC0gYW4gaW50cm9kdWN0aW9uIHRvIHVuaXggc29ja2V0cyBpbiBSdWJ5IiwiY29sb3IiOm51bGwsImJhY2tncm91bmQiOm51bGx9LHsibmFtZSI6ImhlYWRzaG90IiwiaW1hZ2VfdXJsIjoiaHR0cHM6Ly93d3cuaG9uZXliYWRnZXIuaW8vaW1hZ2VzL2hlYWRzaG90cy9zdGFycmgucG5nIn0seyJuYW1lIjoic3VtbWFyeSIsInRleHQiOiJJbiB0aGlzIHBvc3Qgd2Ugc3RhcnQgb3V0IHdpdGggdGhlIGJhc2ljcyBvZiB1bml4IHNvY2tldHMgYW5kIGZpbmlzaCBieSBjcmVhdGluZyBvdXIgb3duIHNpbXBsZSBSdWJ5IGFwcGxpY2F0aW9uIHNlcnZlciB3aGljaCBjYW4gYmUgcHJveGllZCBieSBuZ2lueC4iLCJjb2xvciI6bnVsbCwiYmFja2dyb3VuZCI6bnVsbH0seyJuYW1lIjoiYXV0aG9yIiwidGV4dCI6IkJ5ICpTdGFyciBIb3JuZSoiLCJjb2xvciI6bnVsbCwiYmFja2dyb3VuZCI6bnVsbH0seyJuYW1lIjoidGFncyIsInRleHQiOiIjcnVieSIsImNvbG9yIjpudWxsLCJiYWNrZ3JvdW5kIjpudWxsfV0%26s%3D90d68e46d761745cda0ce858bd0f1497d43d1cfa3ce81bd2b96dda063f029d65)