title: API gateway vs. reverse proxy
body: <p>In order to deal with the microservice architecture, it's often used alongside a Reverse Proxy (such as nginx or apache httpd) and for cross cutting concerns implementation  <a href="https://www.nginx.com/blog/building-microservices-using-an-api-gateway/" rel="noreferrer">API gateway pattern is used</a>. Sometimes Reverse proxy does the work of API gateway.</p>
  <p>It will be good to see clear differences between these two approaches.
  It looks like the potential benefit of API gateway usage is invoking multiple microservices and aggregating the results. All other <a href="https://auth0.com/blog/2015/09/13/an-introduction-to-microservices-part-2-API-gateway/" rel="noreferrer">responsibilities</a> of API gateway can be implemented using Reverse Proxy. Such as:</p>
  <ul>
  <li>Authentication (It can be done using nginx LUA scripts);</li>
  <li>Transport security. It itself Reverse Proxy task;</li>
  <li>Load balancing</li>
  <li>...</li>
  </ul>
  <p>So based on this there are several questions:</p>
  <ol>
  <li>Does it make sense to use API gateway and Reverse proxy simultaneously (as example request -&gt; API gateway -&gt; reverse proxy(nginx) -&gt; concrete microservice)? In what cases ?</li>
  <li>What are the other differences that can be implemented using API gateway and can't be implemented by Reverse proxy and vice versa?</li>
  </ol>