Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created July 10, 2014 18:31
Show Gist options
  • Save vparihar01/3fa67258fadecdd0e3a4 to your computer and use it in GitHub Desktop.
Save vparihar01/3fa67258fadecdd0e3a4 to your computer and use it in GitHub Desktop.
Its very costly to server assets from application server like Passenger or Unicorn or Puma. In this case we would prefer to server our statics directly from nginx. This will help application performance and decrease down the memory consumption.
# if the request is for a static resource, nginx should serve it directly
location ~ ^/(images|javascripts|stylesheets|system|assets|jwplayer)/* {
root /var/www/www.example.com/current/public;
add_header Last-Modified "";
add_header ETag "";
expires max;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment