Skip to content

Instantly share code, notes, and snippets.

@rodrigodealer
Created March 19, 2011 13:56
Show Gist options
  • Save rodrigodealer/877495 to your computer and use it in GitHub Desktop.
Save rodrigodealer/877495 to your computer and use it in GitHub Desktop.
nginx.conf tunning setup
user nobody;
worker_processes 4;
error_log /var/log/nginx/error.log debug;
worker_rlimit_nofile 32768;
events {
worker_connections 8192; # increase for busier servers
use epoll; # you should use epoll here for Linux kernels 2.6.x
multi_accept on;
}
http {
server_name_in_redirect off;
server_names_hash_max_size 2048;
server_names_hash_bucket_size 256;
include mime.types;
default_type application/octet-stream;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
gzip on;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
gzip_proxied any;
gzip_http_version 1.1;
gzip_min_length 0;
gzip_comp_level 9;
gzip_buffers 16 8k;
gzip_types text/* application/* image/*;
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
if_modified_since before;
ignore_invalid_headers on;
client_header_timeout 1m;
client_body_timeout 1m;
send_timeout 1m;
reset_timedout_connection on;
connection_pool_size 256;
client_header_buffer_size 256k;
large_client_header_buffers 4 256k;
client_max_body_size 4M;
client_body_buffer_size 128k;
request_pool_size 32k;
output_buffers 4 32k;
postpone_output 1460;
proxy_cache_path /tmp/nginx/cache levels=1:2 keys_zone=one:30m inactive=1d max_size=500m;
proxy_temp_path /tmp/nginx/proxy;
proxy_cache_key "$scheme://$host$request_uri";
client_body_in_file_only on;
log_format bytes_log "$msec $bytes_sent .";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment