title: Serving nodejs static files in the same domain as my PHP
body: <p>I have website which running on PHP, but also I have NodeJS app which is running on the same domain.
  NodeJs address is <code>/nodejs</code>, all other requests are under PHP.</p>
  
  <ul>
  <li>PHP project located in folder <code>/home/php-project</code> </li>
  <li>PHP static files folder <code>/home/php-project/public</code></li>
  <li>NodeJS is located in - <code>/home/nodejs-project</code>. </li>
  <li>NodeJS static files folder <code>/home/nodejs-project/public</code></li>
  </ul>
  
  <p>Is it possible to serve different static folders?</p>
  
  <p>Here is my NodeJs code </p>
  
  <pre><code>app.use(express.static(__dirname + '/public'));
  </code></pre>
  
  <p>Currently all static files coming from php static folder and I can't get access to nodejs static files.</p>
  
  <p>Here is the nginx config</p>
  
  <pre><code>server {
      listen         80;
      server_name    www.example.com example.com;
      return         301 https://www.example.com$request_uri;
  }
  
  server {
      listen 443 ssl;
      server_name example.com;
  
     #### Comodo SSL
      ssl_certificate path/to;
      ssl_certificate_key path/to;
  
      return 301 https://www.example.com$request_uri;
  }
  
  server {
  
      listen 443 ssl;
      server_name   www.example.com;
  
      #### Comodo SSL
      ssl_certificate path/to;
      ssl_certificate_key path/to;
  
      root /home/php-project/public;
      index index.php;
  
  
      location / {
          autoindex off;
          try_files $uri $uri/ /index.php?$query_string;
      }
  
      location /node-js {
          proxy_pass http://localhost:5555;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_buffering off;
          root /home/node-js;   
      }
  
  
  } #### End server setup
  </code></pre>