Created
July 10, 2014 18:31
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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