Create a gist now

Instantly share code, notes, and snippets.

user nginx;
worker_processes 4;
worker_rlimit_nofile 8192;
#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 10240;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format with_time '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time';
#access_log /tmp/access.log with_time;
sendfile on;
keepalive_timeout 120s;
tcp_nopush on;
tcp_nodelay on;
etag off;
upstream app {
server unix:/tmp/unicorn.sock;
}
server {
root /home/ishocon/webapp/ruby/public;
try_files $uri @app;
etag off;
server_tokens off;
location /images {
open_file_cache max=200;
}
location /css {
open_file_cache max=200;
}
location @app {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_pass http://app;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment