Skip to content

Instantly share code, notes, and snippets.

@RobertBrewitz
Created July 5, 2011 20:50
Show Gist options
  • Save RobertBrewitz/1065889 to your computer and use it in GitHub Desktop.
Save RobertBrewitz/1065889 to your computer and use it in GitHub Desktop.
Nginx baseline configuration for Amazon EC2 instance after tuning session
user www-data www-data;
pid /var/run/nginx.pid;
worker_rlimit_nofile 58064;
worker_processes 1;
events {
use epoll;
worker_connections 58064;
}
http {
server_tokens off;
default_type text/html;
include /usr/local/nginx/conf/mime.types;
open_file_cache max=4096 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
variables_hash_bucket_size 128;
variables_hash_max_size 1024;
log_format gzip '[$status @ $time_local] "$request" "$gzip_ratio" $bytes_sent "$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log gzip buffer=32k;
error_log /var/log/nginx/error.log crit buffer=32k;
gzip on;
gzip_vary on;
gzip_static on;
gzip_comp_level 1;
gzip_min_length 0;
gzip_http_version 1.1;
gzip_proxied any;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript image/bmp;
include /usr/local/nginx/sites-enabled/*;
}
@felipemarques
Copy link

great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment