Skip to content

Instantly share code, notes, and snippets.

@urieljuliatti
Created February 15, 2012 17:42
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 urieljuliatti/1837591 to your computer and use it in GitHub Desktop.
Save urieljuliatti/1837591 to your computer and use it in GitHub Desktop.
Nginx Config
server {
listen 80;
server_name stressmeter.urieljuliatti.com;
access_log /var/log/nginx/production.stressmeter.access.log;
root /home/uriel/stressmeter/current/public;
# Passenger
passenger_enabled on;
rails_env production;
#error_page 404 /404.html;
gzip on;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_min_length 500;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6]\.";
gzip_buffers 16 8k;
#Configuracao de expiracao para imagens e outros arquivos
location ~* \.(ico|css|js|swf|html|htm)(\?[0-9]+)?$ {
if (-f $request_filename) {
access_log off;
expires 5d;
break;
}
}
location ~* /(images|system|public) {
if (-f $request_filename) {
access_log off;
expires 5d;
break;
}
}
location ~ /\. { deny all; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment