title: nginx proxy only serves part of data Wordpress running on Ngninx
body: <p>I have a Wordpress instance running on first nginx server ( Virtual Machine A ) .
  I can work with perfectly fine locally, everythings is well resolved and all path are accessed ( like /wp-admin/ , /wp-content/ , /wp-includes/ etc... ) thru my url www.corph.mouradcloud.com</p>
  
  <p>As for now, I am not using SSL, so this a later issue :)</p>
  
  <p>here is the config of my Nginx web instance :</p>
  
  <pre><code>        upstream php-wp {
              server            unix:/var/run/mouradcloud.sock;
          }
  
          server {
              listen            80;
              listen            [::]:80;
              server_name       www.corph.mouradcloud.com;
              root              /var/www/mouradcloud;
  
                  index                     index.php;
  
                  location / {
                          try_files     $uri $uri/ /index.php?$args;
                  }
  
                  location = /favicon.ico {
                          log_not_found off;
                          access_log    off;
                  }
  
                  location = /robots.txt {
                          allow                    all;
                          log_not_found off;
                          access_log    off;
                  }
  
                  location ~ .php$ {
                          include       fastcgi.conf;
                          fastcgi_pass  php-wp;
                  }
  
                  location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
                          expires       max;
                          log_not_found off;
                  }
          }
  </code></pre>
  
  <p>I have a second Nginx server that I use as a Proxy with a different URL ( Virtual Machine B ) . 
  After a little of google, I noticed that some other parameters need to be added to have the PHP scripts thru proxy either. </p>
  
  <p>here is the proxy nginx file : </p>
  
  <pre><code>        server {
                  listen         80;
                  listen         [::]:80;
                  server_name    www.mouradcloud.com;
  
                  location / {
                  proxy_pass http://www.corph.mouradcloud.com;
                  proxy_set_header X-Forwarded-Host $host;
                  proxy_set_header X-Forwarded-For $remote_addr;
                  proxy_set_header X-Forwarded-Proto $scheme;
                  proxy_set_header X-Real-IP $remote_addr;
                  }
  
          }
  </code></pre>
  
  <p>Strangely, when a client is connecting using the web browser dbugger the path /wp-content/ , /wp-includes/ are resolved thru : </p>
  
  <pre><code>    www.corph.mouradcloud.com 
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>    www.mouradcloud.com
  </code></pre>
  
  <p>here is the screenshot of the debugger, we can see that only documents are passing thru the proxy, scripts are rejected while it should not since I am passing every thing thru the proxy in the request.. </p>
  
  <p><a href="https://i.stack.imgur.com/DzlE5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DzlE5.jpg" alt="enter image description here"></a></p>
  
  <p>My guess is there is some parameters that I am missing. </p>
  
  <p>I tryed to add other location like /wp-includes/ , but I ended up screwing everything ... </p>
  
  <p>I reviewed all the SO thread but noone has an answers so far </p>