Skip to content
Shubham JangleResources
Networking

Explore topics

Forward Proxy vs Reverse Proxy

Forward Proxy vs Reverse Proxy

  • Both are servers that sit between a client and a server, but they serve different purposes.

Forward Proxy

  • Imagine using your office laptop to access YouTube.
  • Your request first goes to a Forward Proxy server managed by your company.
  • The proxy checks whether YouTube is allowed.
  • If it is allowed, the proxy forwards your request to YouTube and sends the response back to you.
  • From YouTube's perspective, the request comes from the proxy server rather than directly from your laptop.
  • A Forward Proxy sits on the client side and can:
    • Control internet access.
    • Filter requests.
    • Hide the client's IP address from destination servers.
  • Popular examples include Zscaler and Squid Proxy.

Reverse Proxy

  • Imagine visiting an application like Netflix.
  • You type netflix.com, and your request reaches a Reverse Proxy in front of the application's backend servers.
  • The proxy receives your request and forwards it to an appropriate backend server, instead of exposing every backend server directly.
  • Once the backend responds, the proxy sends the response back to your browser.
  • A Reverse Proxy can also:
    • Distribute traffic across multiple servers.
    • Cache responses.
    • Handle HTTPS encryption.
  • Popular examples include NGINX and HAProxy.

Takeaway

  • Forward Proxy: sits in front of clients and forwards their requests to external servers.
  • Reverse Proxy: sits in front of servers and receives client requests before forwarding them to backend servers.