Rails 3.1: alias /images to /assets directory Rails 3.1: alias /images to /assets directory nginx nginx

Rails 3.1: alias /images to /assets directory


You can do this in nginx

location /images {    alias /usr/share/rails_app/public/assets/images;}

Though I think the bigger problem will be when you run

rake assets:precompile

It will add a md5hash string to your images. This hash string is added to force browsers to download changed images, so it doesn't use the browser cache. Since the names of the images will be different. It might make more sense to host the old images in a static directory with nginx.