title: Spree not loading images on Nginx
body: <p>I'm trying to make images load on <strong>Spree 3.1.0 + Passenger 5.0.30 + Nginx + Capistrano 3.5 + Digital Ocean</strong>, I have followed <a href="https://gorails.com/deploy/ubuntu/16.04" rel="nofollow">Go Rails Tutorial</a> and <a href="http://guides.spreecommerce.org/developer/manual-ubuntu.html#setting-up-nginx" rel="nofollow">Spree documentation</a> but no luck at the moment.</p>
  
  <p>Weird... Is loading my css files but not loading my image-background</p>
  
  <p>my <strong>/etc/nginx/sites-available/default</strong> file:</p>
  
  <pre><code>server {
      listen 80 default_server;
      listen [::]:80 default_server ipv6only=on;
  
      server_name rodeobest.com;
      passenger_enabled on;
      rails_env    production;
      root         /home/deployer/RMG_rodeobest/current/public;
  
      # redirect server error pages to the static page /50x.html
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
  
  
      # if the request is for a static resource, nginx should serve it dir$
      # and add a far future expires header to it, making the browser
      # cache the resource and navigate faster over the website
      location ~ ^/(spree|system|assets)/  {
              root /home/deployer/RMG_rodeobest/current/public;
              expires max;
              break;
      }
  
      location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
              root /home/deployer/RMG_rodeobest/current/public;
      }
  
  }
  </code></pre>
  
  <p>As documentation says, I've changed <code>location ~ ^/(system|assets)/</code> to <code>location ~ ^/(spree|system|assets)/</code> and restart the server, but as I said, no luck. Any idea? thanks in advance</p>
  
  <p>References:</p>
  
  <p><a href="http://grokbase.com/t/gg/spree-user/131bpzf633/cant-get-images-working-in-production-system" rel="nofollow">Reference 1</a>
  <a href="https://www.digitalocean.com/community/questions/how-to-configure-nginx-with-spree-3-images-not-showing-in-rail-s-production-mode" rel="nofollow">Reference 2</a></p>