Reverse Proxy

Tanat Tonguthaisri
3 min readJun 1, 2020

Typically all requests from D would go directly to F, and F would send responses directly to D. With a reverse proxy, all requests from D will go directly to E, and E will send its requests to and receive responses from F. E will then pass along the appropriate responses to D.

ตามปกติแล้ว การเชื่อมต่อจะเริ่มต้นจาก D ไป F โดยตรง และ F จะตอบกลับมาที่ D โดยตรง แต่หากมีรีเวอร์สพร็อกซี่ (Reverse Proxy) การเชื่อมต่อจะเริ่มจาก D ไป E โดยตรง และ E จะทำการสื่อสารขาไปและขากลับกับ F จากนั้น E จะส่งข้อมูลที่ตอบกลับมาไปยัง D

Below we outline some of the benefits of a reverse proxy:
นี่คือประโยชน์บางประการในการใช้รีเวอร์สพร็อกซี่

  • Load balancing — A popular website that gets millions of users every day may not be able to handle all of its incoming site traffic with a single origin server. Instead, the site can be distributed among a pool of different servers, all handling requests for the same site. In this case, a reverse proxy can provide a load balancing solution that will distribute the incoming traffic evenly among the different servers to prevent any single server from becoming overloaded. In the event that a server fails completely, other servers can step up to handle the traffic.
  • โหลดบาล้านซิ่ง (การกระจายปริมาณงาน): เว็บไซต์ที่มีผู้ใช้วันละหลายล้านคนไม่อาจรองรับการจราจรขาเข้าได้ด้วยเครื่องแม่ข่ายเพียงเครื่องเดียว. ไซต์นี้สามารถกระจายปริมาณงานออกไปในกลุ่มเครื่องแม่ข่ายที่ถูกกำหนดให้รองรับปริมาณงานจากไซต์เดียวกันนี้. ในกรณีนี้ รีเวอร์สพร็อกซี่สามารถดำเนินมาตรการโหลดบาล้านซิ่งที่กระจายการจราจรขาเข้าไปยังเครื่องแม่ข่ายต่าง ๆ อย่างเท่าเทียมกันเพื่อป้องกันไม่ให้เครื่องใดเครื่องหนึ่งทำงานหนักจนเกินไป
  • Protection from attacks — With a reverse proxy in place, a web site or service never needs to reveal the IP address of their origin server(s). This makes it much harder for attackers to leverage a targeted attack against them, such as a DDoS attack. Instead the attackers will only be able to target the reverse proxy, such as Cloudflare’s CDN, which will have tighter security and more resources to fend off a cyber attack.
  • Global Server Load Balancing (GSLB) — In this form of load balancing, a website can be distributed on several servers around the globe and the reverse proxy will send clients to the server that’s geographically closest to them. This decreases the distances that requests and responses need to travel, minimizing load times.
  • Caching — A reverse proxy can also cache content, resulting in faster performance. For example, if a user in Paris visits a reverse-proxied website with web servers in Los Angeles, the user might actually connect to a local reverse proxy server in Paris, which will then have to communicate with an origin server in L.A. The proxy server can then cache (or temporarily save) the response data. Subsequent Parisian users who browse the site will then get the locally cached version from the Parisian reverse proxy server, resulting in much faster performance.
  • SSL encryption — Encrypting and decrypting SSL (or TLS) communications for each client can be computationally expensive for an origin server. A reverse proxy can be configured to decrypt all incoming requests and encrypt all outgoing responses, freeing up valuable resources on the origin server.

--

--