title: Proxy Error 502 on Apache2 for Reverse Proxy to NodeJs Subdomain App on Digital Ocean
body: <p><strong>Hello guys</strong></p>
  
  <p>Im trying to deploy my nodejs api on Digital Ocean, under subdomain <a href="https://api.host.com" rel="nofollow noreferrer">https://api.host.com</a>. Its has some path bellow, all starting by /v0.1. </p>
  
  <blockquote>
    <p>For example <a href="https://api.host.com/v0.1/users" rel="nofollow noreferrer">https://api.host.com/v0.1/users</a></p>
  </blockquote>
  
  <p>On this droplet the nodejs app is running over <a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a></p>
  
  <p>At the same droplet i have got other app, a website hosted on Apache and responds at <a href="https://host.com" rel="nofollow noreferrer">https://host.com</a> it works fine.</p>
  
  <p>Im using Apache for Reverse Proxy make all calls from <a href="https://api.host.com/" rel="nofollow noreferrer">https://api.host.com/</a> to <a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a>. </p>
  
  <p>Actually It works only for root path, i mean try to access <a href="https://api.host.com/" rel="nofollow noreferrer">https://api.host.com/</a> responds right but when i try to access other path i get error</p>
  
  <pre><code>Proxy Error
  
  The proxy server received an invalid response from an upstream server.
  The proxy server could not handle the request
  
  Reason: DNS lookup failure for: 127.0.0.1:3000v0.1
  
  Apache/2.4.29 (Ubuntu) Server at api.host.com Port 443
  
  </code></pre>
  
  <p>HTTP Status Code: 502 Proxy Error</p>
  
  <p>my vhost looks like...</p>
  
  <pre><code>&lt;VirtualHost *:80&gt; 
          ...
          ...
          ServerName api.host.com 
          ProxyPass /.well-unknown/ !
          ProxyRequests Off
          ProxyPreserveHost On
          ProxyVia Full
         &lt;Proxy *&gt;
            Require all granted
        &lt;/Proxy&gt;
  
        ProxyPass / http://127.0.0.1:3000/ 
        ProxyPassReverse / http://127.0.0.1:3000/ 
        ...
        ...
   &lt;/VirtualHost&gt;
  
  </code></pre>
  
  <p>Help please!</p>