Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
152 lines (124 sloc) 3.3 KB
user www-data;
pid /run/nginx.pid;
worker_processes 2;
worker_rlimit_nofile 12288;
events {
worker_connections 4096;
}
http {
log_format ltsv "status:$status"
"\ttime:$time_iso8601"
"\treqtime:$request_time"
"\tmethod:$request_method"
"\turi:$request_uri"
"\tprotocol:$server_protocol"
"\tua:$http_user_agent"
"\tforwardedfor:$http_x_forwarded_for"
"\thost:$remote_addr"
"\treferer:$http_referer"
"\tserver_name:$server_name"
"\tvhost:$host"
"\tsize:$body_bytes_sent"
"\treqsize:$request_length"
"\truntime:$upstream_http_x_runtime"
"\tapptime:$upstream_response_time";
error_log /var/log/nginx/error.log warn;
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
open_file_cache max=1024 inactive=60s;
tcp_nopush on;
#gzip on;
#gzip_min_length 1100;
#gzip_buffers 4 8k;
#gzip_types application/atom+xml text/plain text/css text/javascript application/json application/javascript;
#gzip_vary on;
#gzip_disable "MSIE [1-6]\.";
gzip_static on;
keepalive_timeout 65;
proxy_buffers 100 32k;
proxy_buffer_size 8k;
client_body_buffer_size 16k;
client_max_body_size 20M;
upstream app {
server unix:/run/isubata/puma.sock fail_timeout=0;
}
upstream isuone {
server isu1:8080 fail_timeout=0;
keepalive 128;
}
upstream isutwo {
server isu2:8080 fail_timeout=0;
keepalive 128;
}
upstream isuthree {
server isu3:8080 fail_timeout=0;
keepalive 128;
}
upstream fetch {
server isu2:8080 fail_timeout=0;
server isu3:8080 fail_timeout=0;
#server isu2:9000 fail_timeout=0;
#server isu3:9000 fail_timeout=0;
keepalive 128;
}
server {
listen 0.0.0.0:8080 default_server;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
root /home/isucon/git/webapp/public;
location / {
proxy_pass http://app;
}
location /profile {
client_body_buffer_size 5000k;
proxy_pass http://app;
}
location /icons {
add_header Cache-Control "public, max-age=86400";
root /home/isucon/public;
}
}
server {
listen 0.0.0.0:80 default_server;
access_log /var/log/nginx/access.log ltsv;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
root /home/isucon/isubata/webapp/public;
location /favicon.ico {
}
location /fonts/ {
add_header Cache-Control "public, max-age=86400";
}
location /js/ {
add_header Cache-Control "public, max-age=86400";
}
location /css/ {
add_header Cache-Control "public, max-age=86400";
}
location /icons {
try_files $uri @isuone;
add_header Cache-Control "public, max-age=86400";
root /home/isucon/public;
}
location @isuone {
add_header Via "isuone";
proxy_pass http://isuone;
}
location /profile {
client_body_buffer_size 5000k;
proxy_pass http://isuone;
}
location /fetch {
proxy_pass http://fetch;
}
location / {
proxy_pass http://app;
}
}
}