title: Redirection / Proxy of REST API in Apache2
body: <p>I have REST API webservice running on server on address 127.0.0.1:8090 and Apache2 server running on 192.168.10.220, where I have frontend for my app.</p>
  
  <p>In my website config I added lines:</p>
  
  <pre><code>RewriteEngine on
  RewriteRule ^/api/ http://127.0.0.1:8090/
  </code></pre>
  
  <p>And when I'm openning address <a href="http://192.168.10.220/api" rel="nofollow noreferrer">http://192.168.10.220/api</a> in webbrowser I got redirection to 127.0.0.1:8090 and site is not found.</p>
  
  <p>My question is how to redirect it that I will be able to open link for example <a href="http://192.168.10.220/api/login" rel="nofollow noreferrer">http://192.168.10.220/api/login</a> and It will return me result of <a href="http://127.0.0.1:8090/login" rel="nofollow noreferrer">http://127.0.0.1:8090/login</a>, but 127.0.0.1:8090 address will be not seen in browser url.</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p>I found solution, instead RewriteEngine, I should use this:</p>
  
  <pre><code>ProxyPass          /api http://127.0.0.1:8090/api
  ProxyPassReverse   /api http://127.0.0.1:8090/api
  </code></pre>
  
  <p>And now I can use api at address <a href="http://192.168.10.220/api" rel="nofollow noreferrer">http://192.168.10.220/api</a></p>
  
  <p>But I have problem with second proxy:</p>
  
  <pre><code>ProxyPass          /raporty http://192.168.10.200:8080/ekoncept_raporty
  ProxyPassReverse   /raporty http://192.168.10.200:8080/ekoncept_raporty
  </code></pre>
  
  <p>This time it's not api, but web application (reporting system, not mine). I can login and work, but some features I can't see or when I click button it redirects me to login page. I think it's something with coockies or etc.</p>
  
  <p>What parameters should I use in my Proxy config to fix it??</p>