Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I am trying to integrate Spree a popular ecommerce extension for Rails into my app. Every works fine except the images don’t show when run in production mode. So I searched and found that people are running into the same problem and the way to solved it is by reconfiguring the Nginx config file in /etc/nginx/sites-enabled
Now, my default config file is like so …
upstream app_server { server [YOUR IP ADRESS] fail_timeout=0; }
server {
listen 80;
root /home/rails/public;
server_name _;
index index.htm index.html;
location / {
try_files $uri/index.html $uri.html $uri @app;
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|flv|mpeg|avi)$ {
try_files $uri @app;
}
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
}
However, it was solution was solved by add this line in the nginx cofig file above
location ~ ^/(system|assets|spree)/ {
root /home/spree/[application's name]/current/public;
expires max;
break;
}
Here are the references of the solution I found… 1st link from google group 2nd link from google group 3rd link from spree documentation
My quick solution, which works right now, is to set my Rails application in production mode to serve static files (go to production.rb and make serve_static_files to true)… but it was said that this would increases the work load of rails unnecessarily instead of having nginx do it.
So I am trying to find the proper solution to this. I tried add the suggested lines below my nginx config in sites-enabled … still nothing shows up … how do I go about this? I am stuck. Please help!
Btw, I am running on Ubuntu Ruby on Rails on 14.04 (Postgres, Nginx, Unicorn)
ebeecroft
68aa2215160846bca0a00f952c5fdc
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
032f50ee7f7d489db3b05e204fe139
032f50ee7f7d489db3b05e204fe139
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e