Nginx proxy_pass

Hi there,

I’m attempting to proxy images from a staging site to my local dev site, but am still getting 404 errors on all images. The nginx site.conf details have been tested and work on a vagrant nginx box. This is a multisite, using subdomains.

Thanks for any help!

My site.conf looks like:

server {
    server_name  _;
    return 302 $scheme://sitename.dev$request_uri;
}

server {
  server_name ~^(.*)\.sitename\.dev$ sitename.dev;
  root /app/public/;

  index index.php index.html index.htm;

  # need to change http://site.localmultisite.dev/wp-content/uploads/sites/2/2014/10/image.jpg
  # to http://site.livemultisite.com/wp-content/uploads/sites/3/2014/10/image.jpg

  location ~* .(js|css|png|jpg|jpeg|gif|ico|mp3|mov|tif|tiff|swf|txt|html)$ {
    expires 24h;
    log_not_found off;
    try_files $uri $uri/ @production;
  }

  location @production {

    # Site ID 1 on the live site
    if ($host = "https://sitename.dev/usa") {
      rewrite ^/wp-content/uploads/sites/d+/(.*) http://sitename.stagingsitedomain.com/usa/wp-content/uploads/sites/2/$uri;
    }

  }

  include do-not-modify/*.conf;
}

@verticalgrain I cannot seem to find the site.conf? Can you help me?