1

Our setup is two servers:

  • One serves WP installation
  • The other one is used for extra custom functionality.

Server 1 that hosts WP is using Nginx as web server and reverse proxy to Server 2.

In Server 1 we have a simple location block for reverse proxy:

location /foo/ {
   proxy_pass        http://1.1.1.2/foo/;
   proxy_set_header  X-Real-IP  $remote_addr;
   proxy_set_header  Host       $host;
   proxy_redirect off;
   proxy_intercept_errors on;
}

In Server 2 we also have a location block because the platform requires a bit URL rewriting. It's a bit mixed bag because the platform loads some content via index.php?args but there's also static content:

location /foo/ {
   index index.php;
   try_files $uri $uri/ /foo/index.php?$args;
}

The problem we are facing is that while domain.com/foo/?bar, domain.com/foo/bar works great, domain.com/foo/img/photo.png gives 404.

I assume this is due try_files but I can't seem to get it working.

Vasili Syrakis
  • 4,558
  • 3
  • 22
  • 30
jimmy
  • 121
  • 1
  • 5
  • 1
    This wasn't about reverse proxy after all. There was another regex location block in Server 1 that trapped all image requests and they didn't make it to reverse proxy at all. Problem solved. – jimmy Feb 07 '14 at 08:36
  • 1
    Hi Jimmy, If this has been solved, please post your solution as an answer and tick it to complete this question. – Vasili Syrakis Feb 07 '14 at 08:42
  • No problem! Just letting you know, since this is your first question. Welcome to StackExchange. – Vasili Syrakis Feb 08 '14 at 13:05

1 Answers1

0

This wasn't about reverse proxy after all. There was another regex location block in Server 1 that trapped all image requests and they didn't make it to reverse proxy at all. Problem solved.

posted again as an answer to mark the question as solved

jimmy
  • 121
  • 1
  • 5