Skip to content

Instantly share code, notes, and snippets.

@jparbros
Created December 10, 2014 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jparbros/741f1980d6b6ce746286 to your computer and use it in GitHub Desktop.
Save jparbros/741f1980d6b6ce746286 to your computer and use it in GitHub Desktop.
worker_processes 4;
events {
worker_connections 1024;
}
client_body_buffer_size 256K;
client_header_buffer_size 64k;
client_max_body_size 8m;
large_client_header_buffers 8 1024k;
client_body_timeout 12;
client_header_timeout 12;
keepalive_timeout 30;
send_timeout 10;
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log logs/error.log crit;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
open_file_cache max=5000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
upstream load_balancer {
server 127.0.0.1:3000;
}
server {
server_name localhost;
location / {
proxy_buffer_size 4k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 210; # 30 seconds + Unicorn timeout
proxy_buffers 32 4k;
proxy_pass http://load_balancer;
}
location ~* ^/assets/ {
root /home/app/jiffyshirts/public;
expires max;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
gzip_static on;
}
location /server-info.txt {
root /home/app/jiffyshirts/public;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment