From 0d0f8c6792a0289f97f778d8d1dd7b44d0c3dc48 Mon Sep 17 00:00:00 2001 From: "Shota Fukumori (sora_h)" Date: Sat, 31 Oct 2015 15:59:51 +0900 Subject: [PATCH] keepalive via nginx --- 5f/config/nginx.conf | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/5f/config/nginx.conf b/5f/config/nginx.conf index f198c8e..f81af87 100644 --- a/5f/config/nginx.conf +++ b/5f/config/nginx.conf @@ -8,12 +8,16 @@ events { http { upstream isu12 { - server isu12a:8080; - server isu12b:8080; - server isu12c:8080; + server isu12a:8081; + server isu12b:8081; + server isu12c:8081; keepalive 8; } + upstream unicorn { + server unix:/tmp/unicorn.sock; + } + log_format ltsv "status:$status" "\ttime:$time_iso8601" "\treqtime:$request_time" @@ -69,4 +73,18 @@ http { proxy_pass http://isu12; } } + + server { + listen 8081; + + location ~ ^/(js|css|fonts)/ { + root /home/isucon/shirokanezoo/5f/webapp/static; + expires max; + } + + location / { + proxy_set_header Host $host; + proxy_pass http://unicorn; + } + } }