Skip to content

Instantly share code, notes, and snippets.

@m3nd3s
Created August 12, 2012 19:37
Show Gist options
  • Save m3nd3s/3334030 to your computer and use it in GitHub Desktop.
Save m3nd3s/3334030 to your computer and use it in GitHub Desktop.
Arquivo de configuração do Nginx
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 512;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
# Paths para o passenger e o ruby utilizados
passenger_root /usr/local/rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.15;
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby;
# Vide mais configurações em: http://www.modrails.com/documentation/Users%20guide%20Nginx.html
passenger_max_pool_size 4;
passenger_max_instances_per_app 2;
passenger_pool_idle_time 10;
passenger_log_level 2;
# Buffer
client_body_buffer_size 8K;
client_header_buffer_size 1k;
client_max_body_size 5m;
large_client_header_buffers 2 1k;
# Timeouts
client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 15;
send_timeout 10;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Para melhorar a organização os .conf foram separados em conf.d e sites-enabled (no estilo do Apache)
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment