title: Subdirectory set as subdomain
body: <p>I have server with Nginx at front and nodejs which run reactjs application and my application is divided to few parts and I want to each part got own subdomain.
  Example:</p>
  
  <p><a href="http://192.168.1.1:9000/part1/" rel="nofollow noreferrer">http://192.168.1.1:9000/part1/</a> --- > <a href="http://sub1.example.com/" rel="nofollow noreferrer">http://sub1.example.com/</a></p>
  
  <p><a href="http://192.168.1.1:9000/part2/" rel="nofollow noreferrer">http://192.168.1.1:9000/part2/</a> --- > <a href="http://sub2.example.com/" rel="nofollow noreferrer">http://sub2.example.com/</a></p>
  
  <p>I did something like this: </p>
  
  <pre><code>server {
     listen 80;
     server_name sub1.example.com;
     root html;
     index index.html index.htm;
  
    location / {
             proxy_pass http://127.0.0.1:9000/part1/;
    }}
  </code></pre>
  
  <p>Server works when i used this config but when I open browser I've got error which telling me about problem with static content.</p>
  
  <p>Server trying take static content from <a href="http://127.0.0.1:9000/part1/" rel="nofollow noreferrer">http://127.0.0.1:9000/part1/</a></p>
  
  <p>Should take from <a href="http://127.0.0.1:9000/" rel="nofollow noreferrer">http://127.0.0.1:9000/</a></p>
  
  <p>Thanks for the help in advance.</p>